@Override public int read() throws IOException { read = true; int i = super.read(); read = false; if (i > 0) { fsos.write(i); } else { saved = true; } return i; }
@Override public int read(byte[] b, int off, int len) throws IOException { read = true; int bytes = super.read(b, off, len); read = false; if (bytes > 0) { fsos.write(b, off, bytes); } else if (bytes == -1) { saved = true; } return bytes; }
@Override public int read(byte[] b, int off, int len) throws IOException { read = true; int bytes = super.read(b, off, len); read = false; if (bytes > 0) { fsos.write(b, off, bytes); } else if (bytes == -1) { saved = true; } return bytes; }
FileStoreOutputStream fsos = fsisf.getOuputStream(); byte[] b = new byte[DataTypeManager.MAX_LOB_MEMORY_BYTES + 1]; fsos.write(b); fsos.close(); BlobType blob1 = new BlobType(new BlobImpl(fsisf));
if (binary) { if (val instanceof BinaryType) { result.getOuputStream().write(((BinaryType)val).getBytesDirect()); return;
if (binary) { if (val instanceof BinaryType) { result.getOuputStream().write(((BinaryType)val).getBytesDirect()); return;
if (binary) { if (val instanceof BinaryType) { result.getOuputStream().write(((BinaryType)val).getBytesDirect()); return;
@Override public int read() throws IOException { read = true; int i = super.read(); read = false; if (i > 0) { fsos.write(i); } else { saved = true; } return i; }
@Override public void write(int b) throws IOException { singleByte[0] = (byte)b; write(singleByte, 0, 1); }
@Override public int read() throws IOException { read = true; int i = super.read(); read = false; if (i > 0) { fsos.write(i); } else { saved = true; } return i; }
@Override public int read(byte[] b, int off, int len) throws IOException { read = true; int bytes = super.read(b, off, len); read = false; if (bytes > 0) { fsos.write(b, off, bytes); } else if (bytes == -1) { saved = true; } return bytes; }
@Override public void write(int b) throws IOException { singleByte[0] = (byte)b; write(singleByte, 0, 1); }
@Test public void testClose() throws Exception { FileStorageManager sm = getStorageManager(null, null); FileStore store = sm.createFileStore("0"); FileStoreOutputStream fsos = store.createOutputStream(2); fsos.write(new byte[100000]); fsos.close(); fsos.close(); }
@Test public void testGrowth() throws Exception { FileStorageManager sm = getStorageManager(null, null); FileStore store = sm.createFileStore("0"); FileStoreOutputStream fsos = store.createOutputStream(1<<15); assertTrue(fsos.getBuffer().length < 1<<15); fsos.write(1); fsos.write(new byte[1<<14]); fsos.flush(); assertEquals(1 + (1<<14), fsos.getCount()); assertEquals(1<<15, fsos.getBuffer().length); }
@Override public void write(int b) throws IOException { singleByte[0] = (byte)b; write(singleByte, 0, 1); }