diff --git a/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonWriter.java b/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonWriter.java index 09ecaf7e0..fb5d1a4f2 100644 --- a/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonWriter.java +++ b/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonWriter.java @@ -94,6 +94,23 @@ public final class BsonWriter implements Writer { System.arraycopy(chs, 0, content, position, chs.length); } + public void writeTo(int position, short value) { + writeTo(position, (byte) (value >> 8), (byte) value); + } + + public void writeTo(int position, char value) { + writeTo(position, (byte) ((value & 0xFF00) >> 8), (byte) (value & 0xFF)); + } + + public void writeTo(int position, int value) { + writeTo(position, (byte) (value >> 24), (byte) (value >> 16), (byte) (value >> 8), (byte) value); + } + + public void writeTo(int position, long value) { + writeTo(position, (byte) (value >> 56), (byte) (value >> 48), (byte) (value >> 40), (byte) (value >> 32), + (byte) (value >> 24), (byte) (value >> 16), (byte) (value >> 8), (byte) value); + } + public void writeTo(final byte ch) { expand(1); content[count++] = ch;