/** {@inheritDoc} */ @Override public abstract void write(byte[] buf, int off, int len) throws IOException;
private DfsBlock flushBlock() throws IOException { if (isEmptyPack) throw new IOException(DfsText.get().willNotStoreEmptyPack); out.write(currBuf, 0, currEnd); byte[] buf; if (currEnd == currBuf.length) { buf = currBuf; } else { buf = new byte[currEnd]; System.arraycopy(currBuf, 0, buf, 0, currEnd); } DfsBlock v = new DfsBlock(packKey, currPos, buf); readBlock = v; blockCache.put(v); return v; }
private void flushBlock() throws IOException { out.write(currBuf, 0, currPtr); byte[] buf; if (currPtr == currBuf.length) buf = currBuf; else buf = copyOf(currBuf, 0, currPtr); cache.put(new DfsBlock(packKey, currPos, buf)); currPos += currPtr; currPtr = 0; currBuf = null; }
/** {@inheritDoc} */ @Override public abstract void write(byte[] buf, int off, int len) throws IOException;
@Override public abstract void write(byte[] buf, int off, int len) throws IOException;
private DfsBlock flushBlock() throws IOException { if (isEmptyPack) throw new IOException(DfsText.get().willNotStoreEmptyPack); out.write(currBuf, 0, currEnd); byte[] buf; if (currEnd == currBuf.length) { buf = currBuf; } else { buf = new byte[currEnd]; System.arraycopy(currBuf, 0, buf, 0, currEnd); } DfsBlock v = new DfsBlock(packKey, currPos, buf); readBlock = v; blockCache.put(v); return v; }
private DfsBlock flushBlock() throws IOException { if (isEmptyPack) throw new IOException(DfsText.get().willNotStoreEmptyPack); out.write(currBuf, 0, currEnd); byte[] buf; if (currEnd == currBuf.length) { buf = currBuf; } else { buf = new byte[currEnd]; System.arraycopy(currBuf, 0, buf, 0, currEnd); } DfsBlock v = new DfsBlock(packKey, currPos, buf); readBlock = v; blockCache.put(v); return v; }
private void flushBlock() throws IOException { out.write(currBuf, 0, currPtr); byte[] buf; if (currPtr == currBuf.length) buf = currBuf; else buf = copyOf(currBuf, 0, currPtr); cache.put(new DfsBlock(packKey, currPos, buf)); currPos += currPtr; currPtr = 0; currBuf = null; }
private void flushBlock() throws IOException { out.write(currBuf, 0, currPtr); byte[] buf; if (currPtr == currBuf.length) buf = currBuf; else buf = copyOf(currBuf, 0, currPtr); cache.put(new DfsBlock(packKey, currPos, buf)); currPos += currPtr; currPtr = 0; currBuf = null; }