/** * @return Returns the size of the {@link RamFileData}. */ int size() { return data == null ? 0 : data.size(); }
/** * @return Returns the size of the {@link RamFileData}. */ int size() { return data == null ? 0 : data.size(); }
/** * @return Returns the size of the {@link RamFileData}. */ int size() { return data == null ? 0 : data.size(); }
/** * @return Returns the size of the {@link RamFileData}. */ int size() { return data == null ? 0 : data.size(); }
/** * @return Returns the size of the FileSystem */ long size() { long size = 0; synchronized (cache) { final Iterator<RamFileData> iter = cache.values().iterator(); while (iter.hasNext()) { final RamFileData data = iter.next(); size += data.size(); } } return size; }
/** * @return Returns the size of the FileSystem */ long size() { long size = 0; synchronized (cache) { final Iterator<RamFileData> iter = cache.values().iterator(); while (iter.hasNext()) { final RamFileData data = iter.next(); size += data.size(); } } return size; }
/** * @return Returns the size of the FileSystem */ long size() { long size = 0; synchronized (cache) { final Iterator<RamFileData> iter = cache.values().iterator(); while (iter.hasNext()) { final RamFileData data = iter.next(); size += data.size(); } } return size; }
/** * @return Returns the size of the FileSystem */ long size() { long size = 0; synchronized (cache) { final Iterator<RamFileData> iter = cache.values().iterator(); while (iter.hasNext()) { final RamFileData data = iter.next(); size += data.size(); } } return size; }
/** * Resize the buffer * * @param newSize The new buffer size. */ void resize(final long newSize) { // A future implementation may allow longs/multiple buffer/and so on if (newSize > Integer.MAX_VALUE) { throw new IllegalArgumentException( String.format("newSize(%d) > Integer.MAX_VALUE(%d)", newSize, Integer.MAX_VALUE)); } final int resize = (int) newSize; final int size = this.size(); final byte[] newBuf = new byte[resize]; System.arraycopy(this.content, 0, newBuf, 0, Math.min(resize, size)); this.content = newBuf; updateLastModified(); }
/** * Resize the buffer * * @param newSize The new buffer size. */ void resize(final long newSize) { // A future implementation may allow longs/multiple buffer/and so on if (newSize > Integer.MAX_VALUE) { throw new IllegalArgumentException( String.format("newSize(%d) > Integer.MAX_VALUE(%d)", newSize, Integer.MAX_VALUE)); } final int resize = (int) newSize; final int size = this.size(); final byte[] newBuf = new byte[resize]; System.arraycopy(this.content, 0, newBuf, 0, Math.min(resize, size)); this.content = newBuf; updateLastModified(); }
/** * Resize the buffer * * @param newSize The new buffer size. */ void resize(final long newSize) { // A future implementation may allow longs/multiple buffer/and so on if (newSize > Integer.MAX_VALUE) { throw new IllegalArgumentException( String.format("newSize(%d) > Integer.MAX_VALUE(%d)", newSize, Integer.MAX_VALUE)); } final int resize = (int) newSize; final int size = this.size(); final byte[] newBuf = new byte[resize]; System.arraycopy(this.content, 0, newBuf, 0, Math.min(resize, size)); this.content = newBuf; updateLastModified(); }
/** * Resize the buffer * * @param newSize The new buffer size. */ void resize(final long newSize) { // A future implementation may allow longs/multiple buffer/and so on if (newSize > Integer.MAX_VALUE) { throw new IllegalArgumentException(String.format("newSize(%d) > Integer.MAX_VALUE(%d)", newSize, Integer.MAX_VALUE)); } final int resize = (int) newSize; final int size = this.size(); final byte[] newBuf = new byte[resize]; System.arraycopy(this.content, 0, newBuf, 0, Math.min(resize, size)); this.content = newBuf; updateLastModified(); }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }