Codota Logo
StreamWrapper.getStream
Code IndexAdd Codota to your IDE (free)

How to use
getStream
method
in
org.postgresql.util.StreamWrapper

Best Java code snippets using org.postgresql.util.StreamWrapper.getStream (Showing top 10 results out of 315)

  • Common ways to obtain StreamWrapper
private void myMethod () {
StreamWrapper s =
  • Codota IconInputStream stream;new StreamWrapper(stream, length)
  • Codota Iconnew StreamWrapper(data, offset, length)
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

/**
 * Send a streamable bytea encoded as a text representation with an arbitary encoding.
 */
private void streamBytea(StreamWrapper param, Writer encodingWriter) throws IOException {
  // NB: we escape everything in this path, as I don't like assuming
  // that byte values 32..127 will make it through the encoding
  // unscathed..
  InputStream stream = param.getStream();
  char[] buffer = new char[] { '\\', '\\', 0, 0, 0 };
  if (useEStringSyntax)
  {
    encodingWriter.write(' ');
    encodingWriter.write('E');
  }
  encodingWriter.write('\'');
  for (int remaining = param.getLength(); remaining > 0; --remaining)
  {
    int nextByte = stream.read();
    buffer[2] = (char)( '0' + ((nextByte >> 6) & 3));
    buffer[3] = (char)( '0' + ((nextByte >> 3) & 7));
    buffer[4] = (char)( '0' + (nextByte & 7));
    encodingWriter.write(buffer, 0, 5);
  }
  encodingWriter.write('\'');
}
origin: org.postgresql/postgresql

private static void streamBytea(PGStream pgStream, StreamWrapper wrapper) throws IOException {
 byte[] rawData = wrapper.getBytes();
 if (rawData != null) {
  pgStream.send(rawData, wrapper.getOffset(), wrapper.getLength());
  return;
 }
 pgStream.sendStream(wrapper.getStream(), wrapper.getLength());
}
origin: postgresql/postgresql

private static void streamBytea(PGStream pgStream, StreamWrapper wrapper) throws IOException {
  byte[] rawData = wrapper.getBytes();
  if (rawData != null)
  {
    pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
    return ;
  }
  pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
}
origin: postgresql/postgresql

private void copyStream(PGStream pgStream, StreamWrapper wrapper) throws IOException {
  byte[] rawData = wrapper.getBytes();
  if (rawData != null)
  {
    pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
    return ;
  }
  pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Send a streamable bytea encoded as a text representation with an arbitary encoding.
 */
private void streamBytea(StreamWrapper param, Writer encodingWriter) throws IOException {
  // NB: we escape everything in this path, as I don't like assuming
  // that byte values 32..127 will make it through the encoding
  // unscathed..
  InputStream stream = param.getStream();
  char[] buffer = new char[] { '\\', '\\', 0, 0, 0 };
  if (useEStringSyntax)
  {
    encodingWriter.write(' ');
    encodingWriter.write('E');
  }
  encodingWriter.write('\'');
  for (int remaining = param.getLength(); remaining > 0; --remaining)
  {
    int nextByte = stream.read();
    buffer[2] = (char)( '0' + ((nextByte >> 6) & 3));
    buffer[3] = (char)( '0' + ((nextByte >> 3) & 7));
    buffer[4] = (char)( '0' + (nextByte & 7));
    encodingWriter.write(buffer, 0, 5);
  }
  encodingWriter.write('\'');
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Send a streamable bytea encoded as a text representation with an arbitary encoding.
 */
private void streamBytea(StreamWrapper param, Writer encodingWriter) throws IOException {
  // NB: we escape everything in this path, as I don't like assuming
  // that byte values 32..127 will make it through the encoding
  // unscathed..
  InputStream stream = param.getStream();
  char[] buffer = new char[] { '\\', '\\', 0, 0, 0 };
  if (useEStringSyntax)
  {
    encodingWriter.write(' ');
    encodingWriter.write('E');
  }
  encodingWriter.write('\'');
  for (int remaining = param.getLength(); remaining > 0; --remaining)
  {
    int nextByte = stream.read();
    buffer[2] = (char)( '0' + ((nextByte >> 6) & 3));
    buffer[3] = (char)( '0' + ((nextByte >> 3) & 7));
    buffer[4] = (char)( '0' + (nextByte & 7));
    encodingWriter.write(buffer, 0, 5);
  }
  encodingWriter.write('\'');
}
origin: org.ancoron.postgresql/org.postgresql.osgi

private void copyStream(PGStream pgStream, StreamWrapper wrapper) throws IOException {
  byte[] rawData = wrapper.getBytes();
  if (rawData != null)
  {
    pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
    return ;
  }
  pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
}
origin: org.ancoron.postgresql/org.postgresql

private void copyStream(PGStream pgStream, StreamWrapper wrapper) throws IOException {
  byte[] rawData = wrapper.getBytes();
  if (rawData != null)
  {
    pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
    return ;
  }
  pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
}
origin: org.ancoron.postgresql/org.postgresql

private static void streamBytea(PGStream pgStream, StreamWrapper wrapper) throws IOException {
  byte[] rawData = wrapper.getBytes();
  if (rawData != null)
  {
    pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
    return ;
  }
  pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
}
origin: org.ancoron.postgresql/org.postgresql.osgi

private static void streamBytea(PGStream pgStream, StreamWrapper wrapper) throws IOException {
  byte[] rawData = wrapper.getBytes();
  if (rawData != null)
  {
    pgStream.Send(rawData, wrapper.getOffset(), wrapper.getLength());
    return ;
  }
  pgStream.SendStream(wrapper.getStream(), wrapper.getLength());
}
org.postgresql.utilStreamWrappergetStream

Popular methods of StreamWrapper

  • <init>
  • getBytes
  • getLength
  • getOffset
  • copyStream

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
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