diff options
| author | David Hows <david.hows@mongodb.com> | 2017-01-06 12:12:50 +1100 |
|---|---|---|
| committer | David Hows <david.hows@mongodb.com> | 2017-01-06 12:12:50 +1100 |
| commit | d48181f6f4db08761ed7b80b0332908b272ad0d0 (patch) | |
| tree | 38929fdcc5415ee7b001b6f1a406bd5bd777b737 /lang/java/src | |
| parent | 040e3d6f764c0fb626cb47fede54469f57d0c6e0 (diff) | |
| parent | 8d2324943364286056ae399043f70b8a937de312 (diff) | |
Merge branch 'mongodb-3.6' into mongodb-3.2mongodb-3.2.12
Diffstat (limited to 'lang/java/src')
| -rw-r--r-- | lang/java/src/com/wiredtiger/db/PackOutputStream.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lang/java/src/com/wiredtiger/db/PackOutputStream.java b/lang/java/src/com/wiredtiger/db/PackOutputStream.java index 46b3aef0974..b6804a2992f 100644 --- a/lang/java/src/com/wiredtiger/db/PackOutputStream.java +++ b/lang/java/src/com/wiredtiger/db/PackOutputStream.java @@ -42,6 +42,7 @@ public class PackOutputStream { protected PackFormatInputStream format; protected ByteArrayOutputStream packed; protected byte[] intBuf; + protected boolean isRaw; /** * Constructor. @@ -50,9 +51,21 @@ public class PackOutputStream { * defines the layout of this packed value. */ public PackOutputStream(String format) { - this.format = new PackFormatInputStream(format, false); - intBuf = new byte[MAX_INT_BYTES]; - packed = new ByteArrayOutputStream(100); + this(format, false); + } + + /** + * Constructor. + * + * \param format A String that contains the WiredTiger format that + * defines the layout of this packed value. + * \param isRaw The stream is opened raw. + */ + public PackOutputStream(String format, boolean isRaw) { + this.format = new PackFormatInputStream(format, isRaw); + this.intBuf = new byte[MAX_INT_BYTES]; + this.packed = new ByteArrayOutputStream(100); + this.isRaw = isRaw; } /** @@ -111,7 +124,9 @@ public class PackOutputStream { throws WiredTigerPackingException { int padBytes = 0; - format.checkType('U', false); + if (!isRaw) { + format.checkType('U', false); + } boolean havesize = format.hasLength(); char type = format.getType(); if (havesize) { |
