summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java')
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java
index 46b3aef0974..b6804a2992f 100644
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java
+++ b/src/third_party/wiredtiger/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) {