public int read(byte[] buf, int off, int siz) throws IOException { checkClosed(); int got = 0; while( got < siz && gotBuf() ) { buf[off+got++] = this.buf[at++]; } return got; }
public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); }
@Override public byte[] readFromCopy(boolean block) throws SQLException { return readFromCopy(); }
public int available() throws IOException { checkClosed(); return (buf != null ? len - at : 0); }
public byte[] readFromCopy() throws SQLException { byte[] result = buf; try { if (gotBuf()) { if (at > 0 || len < buf.length) { byte[] ba = new byte[len - at]; for (int i = at; i < len; i++) { ba[i - at] = buf[i]; } result = ba; } at = len; // either partly or fully returned, buffer is exhausted } } catch (IOException ioe) { throw new PSQLException(GT.tr("Read from copy failed."), PSQLState.CONNECTION_FAILURE); } return result; }
public int available() throws IOException { checkClosed(); return ( buf != null ? len - at : 0 ); }
public byte[] readFromCopy() throws SQLException { byte[] result = buf; try { if(gotBuf()) { if(at>0 || len < buf.length) { byte[] ba = new byte[len-at]; for(int i=at; i<len; i++) ba[i-at] = buf[i]; result = ba; } at = len; // either partly or fully returned, buffer is exhausted } } catch(IOException ioe) { throw new PSQLException(GT.tr("Read from copy failed."), PSQLState.CONNECTION_FAILURE); } return result; }
public int read(byte[] buf, int off, int siz) throws IOException { checkClosed(); int got = 0; boolean didReadSomething = false; while (got < siz && (didReadSomething = gotBuf())) { buf[off + got++] = this.buf[at++]; } return got == 0 && !didReadSomething ? -1 : got; }
public int available() throws IOException { checkClosed(); return ( buf != null ? len - at : 0 ); }
public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); }
public byte[] readFromCopy() throws SQLException { byte[] result = buf; try { if(gotBuf()) { if(at>0 || len < buf.length) { byte[] ba = new byte[len-at]; for(int i=at; i<len; i++) ba[i-at] = buf[i]; result = ba; } at = len; // either partly or fully returned, buffer is exhausted } } catch(IOException ioe) { throw new PSQLException(GT.tr("Read from copy failed."), PSQLState.CONNECTION_FAILURE); } return result; }
public int read() throws IOException { checkClosed(); return gotBuf() ? buf[at++] : -1; }
public int available() throws IOException { checkClosed(); return ( buf != null ? len - at : 0 ); }
public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); }
public byte[] readFromCopy() throws SQLException { byte[] result = buf; try { if(gotBuf()) { if(at>0 || len < buf.length) { byte[] ba = new byte[len-at]; for(int i=at; i<len; i++) ba[i-at] = buf[i]; result = ba; } at = len; // either partly or fully returned, buffer is exhausted } } catch(IOException ioe) { throw new PSQLException(GT.tr("Read from copy failed."), PSQLState.CONNECTION_FAILURE); } return result; }
public int read() throws IOException { checkClosed(); return gotBuf() ? buf[at++] : -1; }
public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); }
public int read(byte[] buf, int off, int siz) throws IOException { checkClosed(); int got = 0; while( got < siz && gotBuf() ) { buf[off+got++] = this.buf[at++]; } return got; }
public int read(byte[] buf, int off, int siz) throws IOException { checkClosed(); int got = 0; while( got < siz && gotBuf() ) { buf[off+got++] = this.buf[at++]; } return got; }
public int read() throws IOException { checkClosed(); return gotBuf() ? buf[at++] : -1; }