@Test public void testWrite_partialArray_appendMode() throws IOException { JimfsOutputStream out = newOutputStream(true); addBytesToStore(out, 9, 8, 7); out.write(new byte[] {1, 2, 3, 4, 5, 6}, 1, 3); assertStoreContains(out, 9, 8, 7, 2, 3, 4); }
@Override public synchronized void write(int b) throws IOException { checkNotClosed(); file.writeLock().lock(); try { if (append) { pos = file.sizeWithoutLocking(); } file.write(pos++, (byte) b); file.updateModifiedTime(); } finally { file.writeLock().unlock(); } }
JimfsOutputStream extends OutputStream { @Override public synchronized void write(int b) throws IOException { checkNotClosed(); file.writeLock().lock(); try { if (append) { pos = file.sizeWithoutLocking(); } file.write(pos++, (byte) b); file.updateModifiedTime(); } finally { file.writeLock().unlock(); } } }
JimfsOutputStream extends OutputStream { @Override public synchronized void write(int b) throws IOException { checkNotClosed(); file.writeLock().lock(); try { if (append) { pos = file.sizeWithoutLocking(); } file.write(pos++, (byte) b); file.updateModifiedTime(); } finally { file.writeLock().unlock(); } } JimfsOutputStream(RegularFile file, boolean append, FileSystemState fileSystemState); }
JimfsOutputStream extends OutputStream { @Override public synchronized void write(int b) throws IOException { checkNotClosed(); file.writeLock().lock(); try { if (append) { pos = file.sizeWithoutLocking(); } file.write(pos++, (byte) b); file.updateModifiedTime(); } finally { file.writeLock().unlock(); } } JimfsOutputStream(RegularFile file, boolean append, FileSystemState fileSystemState); @Override synchronized void write(int b); @Override void write(byte[] b); @Override void write(byte[] b, int off, int len); @Override synchronized void close(); }
JimfsOutputStream extends OutputStream { @Override public synchronized void write(int b) throws IOException { checkNotClosed(); file.writeLock().lock(); try { if (append) { pos = file.sizeWithoutLocking(); } file.write(pos++, (byte) b); file.updateModifiedTime(); } finally { file.writeLock().unlock(); } } JimfsOutputStream(RegularFile file, boolean append, FileSystemState fileSystemState); @Override synchronized void write(int b); @Override void write(byte[] b); @Override void write(byte[] b, int off, int len); @Override synchronized void close();  }