Codota Logo
VisibleBufferedInputStream.getBuffer
Code IndexAdd Codota to your IDE (free)

How to use
getBuffer
method
in
org.postgresql.core.VisibleBufferedInputStream

Best Java code snippets using org.postgresql.core.VisibleBufferedInputStream.getBuffer (Showing top 9 results out of 315)

  • Common ways to obtain VisibleBufferedInputStream
private void myMethod () {
VisibleBufferedInputStream v =
  • Codota IconSocket socket;new VisibleBufferedInputStream(socket.getInputStream(), int1)
  • Smart code suggestions by Codota
}
origin: org.postgresql/postgresql

/**
 * Receives a fixed-size string from the backend.
 *
 * @param len the length of the string to receive, in bytes.
 * @return the decoded string
 * @throws IOException if something wrong happens
 */
public String receiveString(int len) throws IOException {
 if (!pg_input.ensureBytes(len)) {
  throw new EOFException();
 }
 String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(), len);
 pg_input.skip(len);
 return res;
}
origin: postgresql/postgresql

/**
 * Receives a fixed-size string from the backend.
 *
 * @param len the length of the string to receive, in bytes.
 * @return the decoded string
 */
public String ReceiveString(int len) throws IOException {
  if (!pg_input.ensureBytes(len)) {
    throw new EOFException();
  }
  String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
                 len);
  pg_input.skip(len);
  return res;
}
origin: org.postgresql/postgresql

/**
 * Receives a null-terminated string from the backend. If we don't see a null, then we assume
 * something has gone wrong.
 *
 * @return string from back end
 * @throws IOException if an I/O error occurs, or end of file
 */
public String receiveString() throws IOException {
 int len = pg_input.scanCStringLength();
 String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(), len - 1);
 pg_input.skip(len);
 return res;
}
origin: postgresql/postgresql

/**
 * Receives a null-terminated string from the backend. If we don't see a
 * null, then we assume something has gone wrong.
 *
 * @return string from back end
 * @exception IOException if an I/O error occurs, or end of file
 */
public String ReceiveString() throws IOException
{
  int len = pg_input.scanCStringLength();
  String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
                 len - 1);
  pg_input.skip(len);
  return res;
}
origin: org.postgresql/postgresql

/**
 * Receives a fixed-size string from the backend, and tries to avoid "UTF-8 decode failed"
 * errors.
 *
 * @param len the length of the string to receive, in bytes.
 * @return the decoded string
 * @throws IOException if something wrong happens
 */
public EncodingPredictor.DecodeResult receiveErrorString(int len) throws IOException {
 if (!pg_input.ensureBytes(len)) {
  throw new EOFException();
 }
 EncodingPredictor.DecodeResult res;
 try {
  String value = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(), len);
  // no autodetect warning as the message was converted on its own
  res = new EncodingPredictor.DecodeResult(value, null);
 } catch (IOException e) {
  res = EncodingPredictor.decode(pg_input.getBuffer(), pg_input.getIndex(), len);
  if (res == null) {
   Encoding enc = Encoding.defaultEncoding();
   String value = enc.decode(pg_input.getBuffer(), pg_input.getIndex(), len);
   res = new EncodingPredictor.DecodeResult(value, enc.name());
  }
 }
 pg_input.skip(len);
 return res;
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Receives a fixed-size string from the backend.
 *
 * @param len the length of the string to receive, in bytes.
 * @return the decoded string
 */
public String ReceiveString(int len) throws IOException {
  if (!pg_input.ensureBytes(len)) {
    throw new EOFException();
  }
  String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
                 len);
  pg_input.skip(len);
  return res;
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Receives a fixed-size string from the backend.
 *
 * @param len the length of the string to receive, in bytes.
 * @return the decoded string
 */
public String ReceiveString(int len) throws IOException {
  if (!pg_input.ensureBytes(len)) {
    throw new EOFException();
  }
  String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
                 len);
  pg_input.skip(len);
  return res;
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Receives a null-terminated string from the backend. If we don't see a
 * null, then we assume something has gone wrong.
 *
 * @return string from back end
 * @exception IOException if an I/O error occurs, or end of file
 */
public String ReceiveString() throws IOException
{
  int len = pg_input.scanCStringLength();
  String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
                 len - 1);
  pg_input.skip(len);
  return res;
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Receives a null-terminated string from the backend. If we don't see a
 * null, then we assume something has gone wrong.
 *
 * @return string from back end
 * @exception IOException if an I/O error occurs, or end of file
 */
public String ReceiveString() throws IOException
{
  int len = pg_input.scanCStringLength();
  String res = encoding.decode(pg_input.getBuffer(), pg_input.getIndex(),
                 len - 1);
  pg_input.skip(len);
  return res;
}
org.postgresql.coreVisibleBufferedInputStreamgetBuffer

Javadoc

Returns direct handle to the used buffer. Use the #ensureBytesto prefill required bytes the buffer and #getIndex to fetch the current position of the buffer.

Popular methods of VisibleBufferedInputStream

  • <init>
    Creates a new buffer around the given stream.
  • available
  • close
  • compact
    Compacts the unread bytes of the buffer to the beginning of the buffer.
  • doubleBuffer
    Doubles the size of the buffer.
  • ensureBytes
    Ensures that the buffer contains at least n bytes. This method invalidates the buffer and index fiel
  • getIndex
    Returns the current read position in the buffer.
  • moveBufferTo
    Moves bytes from the buffer to the begining of the destination buffer. Also sets the index and endIn
  • read
  • readMore
    Reads more bytes into the buffer.
  • scanCStringLength
    Scans the length of the next null terminated string (C-style string) from the stream.
  • skip
  • scanCStringLength,
  • skip,
  • peek

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Path (java.nio.file)
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now