public class BasicBSONDecoder extends Object implements BSONDecoder
BasicBSONDecoder
exposed several protected members to its subclasses:
protected BSONInput _in
protected BSONCallback _callback
protected int _len
protected int _pos
protected void _binary(String)
protected class BSONInput
BSONCallback
implementation
For example to get away from overriging BasicBSONDecoder._binary(String)
you can use the following piece of code:
public class CustomBSONCallback extends BasicBSONCallback {
public void gotBinary(String name, byte type, byte[] data) {
_put(name,toHex(data));
}
private static String toHex(byte[] bytes) {...}
}
This solution covers majority of the cases.
BSONDecoder
implementationBSONDecoder
interface.
Modifier and Type | Class and Description |
---|---|
protected class |
BasicBSONDecoder.BSONInput
Deprecated.
This class should not be a part of API.
Please see the class-level documentation for a migration instructions.
|
Modifier and Type | Field and Description |
---|---|
protected BSONCallback |
_callback
Deprecated.
This field should not be a part of API.
Please see the class-level documentation for a migration instructions.
|
protected BasicBSONDecoder.BSONInput |
_in
Deprecated.
This field should not be a part of API.
Please see the class-level documentation for a migration instructions.
|
protected int |
_len
Deprecated.
This field should not be a part of API.
Please see the class-level documentation for a migration instructions.
|
protected int |
_pos
Deprecated.
This field should not be a part of API.
Please see the class-level documentation for a migration instructions.
|
Constructor and Description |
---|
BasicBSONDecoder() |
Modifier and Type | Method and Description |
---|---|
protected void |
_binary(String name)
Deprecated.
This method should not be a part of API.
Please see the class-level documentation for a migration instructions.
|
int |
decode(byte[] b,
BSONCallback callback) |
int |
decode(InputStream in,
BSONCallback callback) |
BSONObject |
readObject(byte[] b) |
BSONObject |
readObject(InputStream in) |
@Deprecated protected BasicBSONDecoder.BSONInput _in
@Deprecated protected BSONCallback _callback
@Deprecated protected int _pos
@Deprecated protected int _len
public BSONObject readObject(byte[] b)
readObject
in interface BSONDecoder
public BSONObject readObject(InputStream in) throws IOException
readObject
in interface BSONDecoder
IOException
public int decode(byte[] b, BSONCallback callback)
decode
in interface BSONDecoder
public int decode(InputStream in, BSONCallback callback) throws IOException
decode
in interface BSONDecoder
IOException
@Deprecated protected void _binary(String name) throws IOException
name
- the field nameIOException