/** * Receives a four byte integer from the backend * * @return the integer received from the backend * @exception IOException if an I/O error occurs */ public int ReceiveInteger4() throws IOException { if (pg_input.read(_int4buf) != 4) throw new EOFException(); return (_int4buf[0] & 0xFF) << 24 | (_int4buf[1] & 0xFF) << 16 | (_int4buf[2] & 0xFF) << 8 | _int4buf[3] & 0xFF; }
/** * Receives a two byte integer from the backend. * * @return the integer received from the backend * @throws IOException if an I/O error occurs */ public int receiveInteger2() throws IOException { if (pg_input.read(_int2buf) != 2) { throw new EOFException(); } return (_int2buf[0] & 0xFF) << 8 | _int2buf[1] & 0xFF; }
/** * Receives a two byte integer from the backend * * @return the integer received from the backend * @exception IOException if an I/O error occurs */ public int ReceiveInteger2() throws IOException { if (pg_input.read(_int2buf) != 2) throw new EOFException(); return (_int2buf[0] & 0xFF) << 8 | _int2buf[1] & 0xFF; }
/** * Receives a single character from the backend. * * @return the character received * @throws IOException if an I/O Error occurs */ public int receiveChar() throws IOException { int c = pg_input.read(); if (c < 0) { throw new EOFException(); } return c; }
/** * Receives a four byte integer from the backend. * * @return the integer received from the backend * @throws IOException if an I/O error occurs */ public int receiveInteger4() throws IOException { if (pg_input.read(_int4buf) != 4) { throw new EOFException(); } return (_int4buf[0] & 0xFF) << 24 | (_int4buf[1] & 0xFF) << 16 | (_int4buf[2] & 0xFF) << 8 | _int4buf[3] & 0xFF; }
/** * Receives a single character from the backend * * @return the character received * @exception IOException if an I/O Error occurs */ public int ReceiveChar() throws IOException { int c = pg_input.read(); if (c < 0) throw new EOFException(); return c; }
/** * Reads in a given number of bytes from the backend. * * @param buf buffer to store result * @param off offset in buffer * @param siz number of bytes to read * @throws IOException if a data I/O error occurs */ public void receive(byte[] buf, int off, int siz) throws IOException { int s = 0; while (s < siz) { int w = pg_input.read(buf, off + s, siz - s); if (w < 0) { throw new EOFException(); } s += w; } }
/** * Reads in a given number of bytes from the backend * * @param buf buffer to store result * @param off offset in buffer * @param siz number of bytes to read * @exception IOException if a data I/O error occurs */ public void Receive(byte[] buf, int off, int siz) throws IOException { int s = 0; while (s < siz) { int w = pg_input.read(buf, off + s, siz - s); if (w < 0) throw new EOFException(); s += w; } }
/** * Consume an expected EOF from the backend * @exception SQLException if we get something other than an EOF */ public void ReceiveEOF() throws SQLException, IOException { int c = pg_input.read(); if (c < 0) return; throw new PSQLException(GT.tr("Expected an EOF from server, got: {0}", new Integer(c)), PSQLState.COMMUNICATION_ERROR); }
/** * Consume an expected EOF from the backend. * * @throws IOException if an I/O error occurs * @throws SQLException if we get something other than an EOF */ public void receiveEOF() throws SQLException, IOException { int c = pg_input.read(); if (c < 0) { return; } throw new PSQLException(GT.tr("Expected an EOF from server, got: {0}", c), PSQLState.COMMUNICATION_ERROR); }
/** * Receives a four byte integer from the backend * * @return the integer received from the backend * @exception IOException if an I/O error occurs */ public int ReceiveInteger4() throws IOException { if (pg_input.read(_int4buf) != 4) throw new EOFException(); return (_int4buf[0] & 0xFF) << 24 | (_int4buf[1] & 0xFF) << 16 | (_int4buf[2] & 0xFF) << 8 | _int4buf[3] & 0xFF; }
/** * Receives a four byte integer from the backend * * @return the integer received from the backend * @exception IOException if an I/O error occurs */ public int ReceiveInteger4() throws IOException { if (pg_input.read(_int4buf) != 4) throw new EOFException(); return (_int4buf[0] & 0xFF) << 24 | (_int4buf[1] & 0xFF) << 16 | (_int4buf[2] & 0xFF) << 8 | _int4buf[3] & 0xFF; }
/** * Receives a two byte integer from the backend * * @return the integer received from the backend * @exception IOException if an I/O error occurs */ public int ReceiveInteger2() throws IOException { if (pg_input.read(_int2buf) != 2) throw new EOFException(); return (_int2buf[0] & 0xFF) << 8 | _int2buf[1] & 0xFF; }
/** * Receives a two byte integer from the backend * * @return the integer received from the backend * @exception IOException if an I/O error occurs */ public int ReceiveInteger2() throws IOException { if (pg_input.read(_int2buf) != 2) throw new EOFException(); return (_int2buf[0] & 0xFF) << 8 | _int2buf[1] & 0xFF; }
/** * Receives a single character from the backend * * @return the character received * @exception IOException if an I/O Error occurs */ public int ReceiveChar() throws IOException { int c = pg_input.read(); if (c < 0) throw new EOFException(); return c; }
/** * Receives a single character from the backend * * @return the character received * @exception IOException if an I/O Error occurs */ public int ReceiveChar() throws IOException { int c = pg_input.read(); if (c < 0) throw new EOFException(); return c; }
/** * Reads in a given number of bytes from the backend * * @param buf buffer to store result * @param off offset in buffer * @param siz number of bytes to read * @exception IOException if a data I/O error occurs */ public void Receive(byte[] buf, int off, int siz) throws IOException { int s = 0; while (s < siz) { int w = pg_input.read(buf, off + s, siz - s); if (w < 0) throw new EOFException(); s += w; } }
/** * Reads in a given number of bytes from the backend * * @param buf buffer to store result * @param off offset in buffer * @param siz number of bytes to read * @exception IOException if a data I/O error occurs */ public void Receive(byte[] buf, int off, int siz) throws IOException { int s = 0; while (s < siz) { int w = pg_input.read(buf, off + s, siz - s); if (w < 0) throw new EOFException(); s += w; } }
/** * Consume an expected EOF from the backend * @exception SQLException if we get something other than an EOF */ public void ReceiveEOF() throws SQLException, IOException { int c = pg_input.read(); if (c < 0) return; throw new PSQLException(GT.tr("Expected an EOF from server, got: {0}", new Integer(c)), PSQLState.COMMUNICATION_ERROR); }
/** * Consume an expected EOF from the backend * @exception SQLException if we get something other than an EOF */ public void ReceiveEOF() throws SQLException, IOException { int c = pg_input.read(); if (c < 0) return; throw new PSQLException(GT.tr("Expected an EOF from server, got: {0}", new Integer(c)), PSQLState.COMMUNICATION_ERROR); }