public class BEParser extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.CharMatcher |
IS_DIGIT |
Constructor and Description |
---|
BEParser(byte[] bs)
Create a parser for the provided bencoded document.
|
BEParser(InputStream in)
Create a parser for the provided binary input.
|
BEParser(URL url)
Create a parser for the provided URL's content.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
BEInteger |
readInteger()
Try to read the document's root object as a bencoded integer.
|
BEList |
readList()
Try to read the document's root object as a bencoded list.
|
BEMap |
readMap()
Try to read the document's root object as a bencoded dictionary.
|
BEString |
readString()
Try to read the document's root object as a bencoded string.
|
BEType |
readType()
Read type of the root object of the bencoded document that this parser was created for.
|
public BEParser(URL url)
url
- URL's content must be a well-formed bencoded document.public BEParser(InputStream in)
in
- Input's content must be a well-formed bencoded document.public BEParser(byte[] bs)
bs
- Bencoded document.public BEType readType()
public BEString readString()
readType()
public BEInteger readInteger()
readType()
public BEList readList()
readType()
public BEMap readMap()
readType()
public void close()
close
in interface AutoCloseable
Copyright © 2016–2021. All rights reserved.