@ThreadSafe public class BsonWriter extends Object
Document
representation.Constructor and Description |
---|
BsonWriter() |
Modifier and Type | Method and Description |
---|---|
byte[] |
write(Object object)
Return the array of bytes containing the standard BSON binary form of the supplied in-memory
Document . |
void |
write(Object object,
DataOutput output)
Write to the supplied output the binary BSON representation of the supplied in-memory
Document . |
void |
write(Object object,
OutputStream stream)
Write the supplied in-memory
Document in standard BSON binary format to the supplied stream. |
protected void |
write(String name,
Binary value,
BsonDataOutput output) |
protected void |
write(String name,
boolean value,
BsonDataOutput output) |
protected void |
write(String name,
Code value,
BsonDataOutput output) |
protected void |
write(String name,
CodeWithScope value,
BsonDataOutput output) |
protected void |
write(String name,
Date value,
BsonDataOutput output) |
protected void |
write(String name,
Document document,
BsonDataOutput output) |
protected void |
write(String name,
double value,
BsonDataOutput output) |
protected void |
write(String name,
float value,
BsonDataOutput output) |
protected void |
write(String name,
int value,
BsonDataOutput output) |
protected void |
write(String name,
Iterable<?> arrayValue,
BsonDataOutput output) |
protected void |
write(String name,
long value,
BsonDataOutput output) |
protected void |
write(String name,
MaxKey value,
BsonDataOutput output) |
protected void |
write(String name,
MinKey value,
BsonDataOutput output) |
protected void |
write(String name,
Object object,
BsonDataOutput output) |
protected void |
write(String name,
ObjectId value,
BsonDataOutput output) |
protected void |
write(String name,
Pattern value,
BsonDataOutput output) |
protected void |
write(String name,
String value,
BsonDataOutput output) |
protected void |
write(String name,
Symbol value,
BsonDataOutput output) |
protected void |
write(String name,
Timestamp value,
BsonDataOutput output) |
protected void |
write(String name,
UUID value,
BsonDataOutput output) |
protected void |
writeArray(String name,
Object arrayValue,
BsonDataOutput output) |
protected void |
writeCString(String value,
BsonDataOutput output) |
protected void |
writeNull(String name,
BsonDataOutput output) |
protected void |
writeString(String value,
BsonDataOutput output) |
public void write(Object object, OutputStream stream) throws IOException
Document
in standard BSON binary format to the supplied stream.object
- the BSON object or BSON value; may not be nullstream
- the output stream; may not be nullIOException
- if there was a problem reading from the streampublic byte[] write(Object object) throws IOException
Document
.object
- the BSON object or BSON value; may not be nullIOException
- if there was a problem reading from the streampublic void write(Object object, DataOutput output) throws IOException
Document
.object
- the BSON object or BSON value; may not be nulloutput
- the output; may not be nullIOException
- if there was a problem writing to the ObjectOutputprotected void write(String name, Object object, BsonDataOutput output)
protected void writeCString(String value, BsonDataOutput output)
protected void writeString(String value, BsonDataOutput output)
protected void writeNull(String name, BsonDataOutput output)
protected void write(String name, String value, BsonDataOutput output)
protected void write(String name, boolean value, BsonDataOutput output)
protected void write(String name, int value, BsonDataOutput output)
protected void write(String name, long value, BsonDataOutput output)
protected void write(String name, float value, BsonDataOutput output)
protected void write(String name, double value, BsonDataOutput output)
protected void writeArray(String name, Object arrayValue, BsonDataOutput output)
protected void write(String name, Iterable<?> arrayValue, BsonDataOutput output)
protected void write(String name, Document document, BsonDataOutput output)
protected void write(String name, Binary value, BsonDataOutput output)
protected void write(String name, Symbol value, BsonDataOutput output)
protected void write(String name, Pattern value, BsonDataOutput output)
protected void write(String name, Date value, BsonDataOutput output)
protected void write(String name, UUID value, BsonDataOutput output)
protected void write(String name, CodeWithScope value, BsonDataOutput output)
protected void write(String name, Code value, BsonDataOutput output)
protected void write(String name, Timestamp value, BsonDataOutput output)
protected void write(String name, ObjectId value, BsonDataOutput output)
protected void write(String name, MaxKey value, BsonDataOutput output)
protected void write(String name, MinKey value, BsonDataOutput output)
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.