/** * After retrieving this {@link java.io.OutputStream}, this object will be capable of accepting successively written data to the output * stream. To completely persist this GridFS object, you must finally call the {@link java.io.OutputStream#close()} method on the output * stream. Note that calling the save() and saveChunks() methods will throw Exceptions once you obtained the OutputStream. * * @return Writable stream object. */ public OutputStream getOutputStream() { if (outputStream == null) { outputStream = new GridFSOutputStream(); } return outputStream; }
@Override public void write(final int b) throws IOException { byte[] byteArray = new byte[1]; byteArray[0] = (byte) (b & 0xff); write(byteArray, 0, 1); }
/** * After retrieving this {@link java.io.OutputStream}, this object will be capable of accepting successively written data to the output * stream. To completely persist this GridFS object, you must finally call the {@link java.io.OutputStream#close()} method on the output * stream. Note that calling the save() and saveChunks() methods will throw Exceptions once you obtained the OutputStream. * * @return Writable stream object. */ public OutputStream getOutputStream() { if (outputStream == null) { outputStream = new GridFSOutputStream(); } return outputStream; }
@Override public void write(final int b) throws IOException { byte[] byteArray = new byte[1]; byteArray[0] = (byte) (b & 0xff); write(byteArray, 0, 1); }