This commit is contained in:
地平线
2015-11-03 09:52:37 +08:00
parent 12e0d257cc
commit 47c2282708

View File

@@ -84,6 +84,16 @@ public final class BsonWriter implements Writer {
return newdata;
}
/**
* 往指定的位置写入字节
*
* @param position
* @param chs
*/
public void writeTo(int position, byte... chs) {
System.arraycopy(chs, 0, content, position, chs.length);
}
public void writeTo(final byte ch) {
expand(1);
content[count++] = ch;
@@ -112,6 +122,10 @@ public final class BsonWriter implements Writer {
}
//------------------------------------------------------------------------
public int position() {
return this.count;
}
public final int count() {
return this.count;
}