|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.schematic.document.Bson
public class Bson
A utility class for working with BSON documents.
Nested Class Summary | |
---|---|
static class |
Bson.BinaryType
The bytes used for the subtypes of a binary value within a BSON stream. |
static class |
Bson.Type
The bytes used for the types within a BSON stream. |
Field Summary | |
---|---|
static String |
DATE_FORMAT
|
protected static String |
DATE_FORMAT_FOR_PARSING
|
static byte |
END_OF_DOCUMENT
Byte used for the end of a document within a BSON stream. |
static byte |
END_OF_STRING
Byte used for the end of a string within a BSON stream. |
Constructor Summary | |
---|---|
Bson()
|
Method Summary | |
---|---|
protected static BsonWriter |
getBsonWriter()
|
static DateFormat |
getDateFormatter()
Obtain a DateFormat object that can be used within the current thread to format Date objects. |
static DateFormat |
getDateParsingFormatter()
|
protected static BsonReader |
getReader()
|
static int |
getTypeForValue(Object value)
Get the Bson.Type constant that describes the type of value for the given field name. |
static Document |
read(DataInput input)
Read the binary BSON representation from supplied data input and construct the Document representation. |
static Document |
read(InputStream stream)
Read the binary BSON representation from supplied input stream and construct the Document representation. |
static void |
write(Document bson,
ObjectOutput output)
Write to the supplied output the binary BSON representation of the supplied in-memory Document . |
static void |
write(Document bson,
OutputStream stream)
Write to the supplied stream the binary BSON representation of the supplied in-memory Document . |
static byte[] |
write(Object object)
Return the array of bytes containing the standard BSON binary form of the supplied in-memory Document . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DATE_FORMAT
protected static final String DATE_FORMAT_FOR_PARSING
public static final byte END_OF_DOCUMENT
public static final byte END_OF_STRING
Constructor Detail |
---|
public Bson()
Method Detail |
---|
public static DateFormat getDateFormatter()
DateFormat
object that can be used within the current thread to format Date
objects.
public static DateFormat getDateParsingFormatter()
protected static BsonWriter getBsonWriter()
public static void write(Document bson, OutputStream stream) throws IOException
Document
.
bson
- the BSON object or BSON value; may not be nullstream
- the output stream; may not be null
IOException
- if there was a problem writing to the streampublic static void write(Document bson, ObjectOutput output) throws IOException
Document
.
bson
- the BSON object or BSON value; may not be nulloutput
- the output; may not be null
IOException
- if there was a problem writing to the ObjectOutputpublic static byte[] write(Object object) throws IOException
Document
.
object
- the BSON object or BSON value; may not be null
IOException
- if there was a problem reading from the streamprotected static BsonReader getReader()
public static Document read(InputStream stream) throws IOException
Document
representation.
stream
- the input stream; may not be null
Document
representation
IOException
- if there was a problem reading from the streampublic static Document read(DataInput input) throws IOException
Document
representation.
input
- the data input; may not be null
Document
representation
IOException
- if there was a problem reading from the streampublic static int getTypeForValue(Object value)
Bson.Type
constant that describes the type of value for the given field name.
value
- The value
Bson.Type
constant describing the value
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |