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; boolean didReadSomething = false; while (got < siz && (didReadSomething = gotBuf())) { buf[off + got++] = this.buf[at++]; } return got == 0 && !didReadSomething ? -1 : got; }
public int read() throws IOException { checkClosed(); return gotBuf() ? buf[at++] : -1; }
public int read() throws IOException { checkClosed(); return gotBuf() ? buf[at++] : -1; }
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 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; 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; }
public int read() throws IOException { checkClosed(); return gotBuf() ? buf[at++] : -1; }
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 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; }