@Override public int read() throws IOException { synchronized (stream) { // If it can be pulled direct from the buffer, don't go via the slow path if (stream.hasBufferedInputBytes()) { try { return stream.read(); } catch (BadDescriptorException ex) { throw new IOException(ex.getMessage()); } } } byte[] b = new byte[1]; // java.io.InputStream#read must return an unsigned value; return read(b, 0, 1) == 1 ? b[0] & 0xff: -1; }
@Override public int read() throws IOException { synchronized (stream) { // If it can be pulled direct from the buffer, don't go via the slow path if (stream.hasBufferedInputBytes()) { try { return stream.read(); } catch (BadDescriptorException ex) { throw new IOException(ex.getMessage()); } } } byte[] b = new byte[1]; // java.io.InputStream#read must return an unsigned value; return read(b, 0, 1) == 1 ? b[0] & 0xff: -1; }
@Override public int read() throws IOException { synchronized (stream) { // If it can be pulled direct from the buffer, don't go via the slow path if (stream.hasBufferedInputBytes()) { try { return stream.read(); } catch (BadDescriptorException ex) { throw new IOException(ex.getMessage()); } } } byte[] b = new byte[1]; // java.io.InputStream#read must return an unsigned value; return read(b, 0, 1) == 1 ? b[0] & 0xff: -1; }
@Override public int read() throws IOException { synchronized (stream) { // If it can be pulled direct from the buffer, don't go via the slow path if (stream.hasBufferedInputBytes()) { try { return stream.read(); } catch (BadDescriptorException ex) { throw new IOException(ex.getMessage()); } } } byte[] b = new byte[1]; // java.io.InputStream#read must return an unsigned value; return read(b, 0, 1) == 1 ? b[0] & 0xff: -1; }
public InputStream newInputStream() { InputStream in = descriptor.getBaseInputStream(); return in == null ? new InputStreamAdapter(this) : in; }
public InputStream newInputStream() { InputStream in = descriptor.getBaseInputStream(); return in == null ? new InputStreamAdapter(this) : in; }
public InputStream newInputStream() { InputStream in = descriptor.getBaseInputStream(); return in == null ? new InputStreamAdapter(this) : in; }
public InputStream newInputStream() { InputStream in = descriptor.getBaseInputStream(); return in == null ? new InputStreamAdapter(this) : in; }