public MockValue (final java.io.InputStream val) throws JcrException { super(); this.type = PropertyType.BINARY; try { final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); ByteUtils.copy(val, baos, 1024); this.value = baos.toByteArray(); } catch (final java.io.IOException ie) { throw new JcrException ("failed to fetch data from input stream", ie); } }
out = new java.io.FileOutputStream(destinationPath); ByteUtils.copy(in, out, 1024);
protected byte[] decodeByteArray () throws BeanCoderException { final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); final java.io.InputStream is = this.currentProperty() .getValue().getStream(); try { ByteUtils.copy(is, baos, 1024); } catch (final Throwable t) { throw new BeanCoderException ("Failed to decode byte array for '"+this.currentItemName+ "' out of stream", t); } return baos.toByteArray(); }