public final class Reader
extends java.lang.Object
implements java.io.Closeable
get method.| Modifier and Type | Class and Description |
|---|---|
static class |
Reader.FileMode
The file mode to use when opening a MaxMind DB.
|
| Constructor and Description |
|---|
Reader(java.io.File database)
Constructs a Reader for the MaxMind DB format.
|
Reader(java.io.File database,
Reader.FileMode fileMode)
Constructs a Reader for the MaxMind DB format.
|
Reader(java.io.InputStream source)
Constructs a Reader as if in mode
Reader.FileMode.MEMORY, without using
a File instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the MaxMind DB and returns resources to the system.
|
com.fasterxml.jackson.databind.JsonNode |
get(java.net.InetAddress ipAddress)
Looks up the
address in the MaxMind DB. |
public Reader(java.io.File database)
throws java.io.IOException
database - the MaxMind DB file to use.java.io.IOException - if there is an error opening or reading from the file.public Reader(java.io.InputStream source)
throws java.io.IOException
Reader.FileMode.MEMORY, without using
a File instance.source - the InputStream that contains the MaxMind DB file.java.io.IOException - if there is an error reading from the Stream.public Reader(java.io.File database,
Reader.FileMode fileMode)
throws java.io.IOException
database - the MaxMind DB file to use.fileMode - the mode to open the file with.java.io.IOException - if there is an error opening or reading from the file.public com.fasterxml.jackson.databind.JsonNode get(java.net.InetAddress ipAddress)
throws java.io.IOException
address in the MaxMind DB.ipAddress - the IP address to look up.java.io.IOException - if a file I/O error occurs.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException - if an I/O error occurs.Copyright © 2014 MaxMind, Inc.. All Rights Reserved.