@Override public int readBinaryValue(Base64Variant b64variant, OutputStream out) throws IOException { return delegate.readBinaryValue(b64variant, out); } @Override public JsonLocation getTokenLocation() { return delegate.getTokenLocation(); }
@Override public int readBinaryValue(Base64Variant b64variant, OutputStream out) throws IOException { return delegate.readBinaryValue(b64variant, out); } @Override public JsonLocation getTokenLocation() { return delegate.getTokenLocation(); }
@Override public int readBinaryValue(Base64Variant b64variant, OutputStream out) throws IOException { return delegate.readBinaryValue(b64variant, out); } @Override public JsonLocation getTokenLocation() { return delegate.getTokenLocation(); }
/** * Method that can be used as an alternative to {@link #getBigIntegerValue()}, * especially when value can be large. The main difference (beyond method * of returning content using {@link OutputStream} instead of as byte array) * is that content will NOT remain accessible after method returns: any content * processed will be consumed and is not buffered in any way. If caller needs * buffering, it has to implement it. * * @param out Output stream to use for passing decoded binary data * * @return Number of bytes that were decoded and written via {@link OutputStream} * * @since 2.1 */ public int readBinaryValue(OutputStream out) throws IOException { return readBinaryValue(Base64Variants.getDefaultVariant(), out); }
@Override public ByteBuffer deserialize(JsonParser jp, DeserializationContext ctxt, ByteBuffer intoValue) throws IOException { // Let's actually read in streaming manner... OutputStream out = new ByteBufferBackedOutputStream(intoValue); jp.readBinaryValue(ctxt.getBase64Variant(), out); out.close(); return intoValue; } }
/** * Method that can be used as an alternative to {@link #getBigIntegerValue()}, * especially when value can be large. The main difference (beyond method * of returning content using {@link OutputStream} instead of as byte array) * is that content will NOT remain accessible after method returns: any content * processed will be consumed and is not buffered in any way. If caller needs * buffering, it has to implement it. * * @param out Output stream to use for passing decoded binary data * * @return Number of bytes that were decoded and written via {@link OutputStream} */ public int readBinaryValue(OutputStream out) throws IOException { return readBinaryValue(Base64Variants.getDefaultVariant(), out); }
jp.nextToken(); ByteArrayOutputStream out = new ByteArrayOutputStream(); jp.readBinaryValue(ctxt.getBase64Variant(), out); result = LocalFile.ofContent(out.toByteArray()); } else {
@Override public Byte jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); parser.readBinaryValue(os); byte[] bytes = os.toByteArray(); if (bytes.length == 0) { return null; } else { return bytes[0]; } }
@Override public byte[] jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(500); parser.readBinaryValue(out); return out.toByteArray(); }
@Override public byte[] jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(500); parser.readBinaryValue(out); return out.toByteArray(); }
@Override public File jsonRead(JsonParser parser) throws IOException { File tempFile = File.createTempFile(prefix, suffix, directory); try (OutputStream os = getOutputStream(tempFile)) { parser.readBinaryValue(os); os.flush(); } return tempFile; }
@Override public int readBinaryValue(Base64Variant b64variant, OutputStream out) throws IOException, JsonParseException { return delegate.readBinaryValue(b64variant, out); }
@Override public byte[] jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(500); parser.readBinaryValue(out); return out.toByteArray(); }
@Override public byte[] jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(500); parser.readBinaryValue(out); return out.toByteArray(); }
@Override public Byte jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); parser.readBinaryValue(os); byte[] bytes = os.toByteArray(); if (bytes.length == 0) { return null; } else { return bytes[0]; } }
@Override public byte[] jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(500); parser.readBinaryValue(out); return out.toByteArray(); }
@Override public byte[] jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(500); parser.readBinaryValue(out); return out.toByteArray(); }
@Override public Byte jsonRead(JsonParser parser) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); parser.readBinaryValue(os); byte[] bytes = os.toByteArray(); if (bytes.length == 0) { return null; } else { return bytes[0]; } }
@Override public File jsonRead(JsonParser parser) throws IOException { File tempFile = File.createTempFile(prefix, suffix, directory); OutputStream os = getOutputStream(tempFile); parser.readBinaryValue(os); os.flush(); os.close(); return tempFile; }
@Override public ByteBuffer deserialize(JsonParser jp, DeserializationContext ctxt, ByteBuffer intoValue) throws IOException { // Let's actually read in streaming manner... OutputStream out = new ByteBufferBackedOutputStream(intoValue); jp.readBinaryValue(ctxt.getBase64Variant(), out); out.close(); return intoValue; } }