protected InputStream createBufferedStream(InputStream is) { if (responseBufferSize == 0) { return is; } if (responseBufferSize < 0) { return new SelfExpandingBufferredInputStream(is); } return new BufferedInputStream(is, responseBufferSize); }
public synchronized void close() throws IOException { super.close(); // Response object is no longer needed and can be finalized response = null; } }
@Override public synchronized int read() throws IOException { if (pos == marklimit) { expand(); } return super.read(); }
protected InputStream createBufferedStream(InputStream is) { if (responseBufferSize == 0) { return is; } if (responseBufferSize < 0) { return new SelfExpandingBufferredInputStream(is); } return new BufferedInputStream(is, responseBufferSize); }
@Override public synchronized int read(byte[] b, int off, int len) throws IOException { while (pos + len > marklimit) { expand(); } return super.read(b, off, len); }
public synchronized void close() throws IOException { super.close(); // Response object is no longer needed and can be finalized response = null; } }
public InputStream getInputStream() throws IOException { if (stream == null) { stream = new SelfExpandingBufferredInputStream(new ByteArrayInputStream(getContent(testerResponse))); } return stream; }
@Override public synchronized int read() throws IOException { if (pos == marklimit) { expand(); } return super.read(); }
protected InputStream createBufferedStream(InputStream is) { if (responseBufferSize == 0) { return is; } if (responseBufferSize < 0) { return new SelfExpandingBufferredInputStream(is); } BufferedInputStream bis = new BufferedInputStream(is, responseBufferSize); // mark read limit bis.mark(responseBufferSize); return bis; }
@Override public int read(byte[] b) throws IOException { while (pos + b.length > marklimit) { expand(); } return super.read(b); }
protected InputStream createBufferedStream(InputStream is) { if (responseBufferSize == 0) { return is; } if (responseBufferSize < 0) { return new SelfExpandingBufferredInputStream(is); } BufferedInputStream bis = new BufferedInputStream(is, responseBufferSize); // mark read limit bis.mark(responseBufferSize); return bis; }
@Override public synchronized int read(byte[] b) throws IOException { while (pos + b.length > marklimit) { expand(); } return super.read(b); }
public InputStream getInputStream() { if (stream == null) { stream = new SelfExpandingBufferredInputStream(new ByteArrayInputStream(testerResponse.getContentBytes())); } return stream; }
@Override public synchronized int read(byte[] b, int off, int len) throws IOException { while (pos + len > marklimit) { expand(); } return super.read(b, off, len); }