congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
VisibleBufferedInputStream.getBuffer
Code IndexAdd Tabnine 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)

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

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Menu (java.awt)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now