Package com.caucho.vfs

Examples of com.caucho.vfs.TempBuffer


  public int write(InputStream is, int length)
    throws IOException
  {
    int writeLength = 0;

    TempBuffer tb = TempBuffer.allocate();
    byte []buffer = tb.getBuffer();

    try {
      while (length > 0) {
  int sublen;
View Full Code Here


  @Override
  public StringValue encode(Env env, CharSequence str)
  {
    CharBuffer in = CharBuffer.wrap(str);
   
    TempBuffer tempBuf = TempBuffer.allocate();
   
    try {
      ByteBuffer out = ByteBuffer.wrap(tempBuf.getBuffer());
     
      StringValue sb = env.createBinaryBuilder();

      while (in.hasRemaining()) {
        CoderResult coder = _encoder.encode(in, out, false);
View Full Code Here

   */
  public int write(InputStream is, int length)
  {
    int writeLength = 0;

    TempBuffer tb = TempBuffer.allocate();
    byte []buffer = tb.getBuffer();

    try {
      while (length > 0) {
        int sublen;

View Full Code Here

   */
  public int write(InputStream is, int length)
  {
    int writeLength = 0;

    TempBuffer tb = TempBuffer.allocate();
    byte []buffer = tb.getBuffer();

    try {
      while (length > 0) {
  int sublen;

View Full Code Here

  }

  @Override
  public int write(InputStream is, int length) throws IOException
  {
    TempBuffer tempBuffer = TempBuffer.allocate();
    byte []buffer = tempBuffer.getBuffer();
   
    int writeLength = length;
   
    while (length > 0) {
      int sublen = buffer.length;
View Full Code Here

   */
  public StringValue read(int length)
    throws IOException
  {
    StringValue bb = _env.createBinaryBuilder();
    TempBuffer temp = TempBuffer.allocate();
   
    try {
      byte []buffer = temp.getBuffer();

      while (length > 0) {
        int sublen = buffer.length;

        if (length < sublen)
View Full Code Here

   * Prints out the remaining data in the stream to stdout
   */
  public Value gzpassthru(Env env, @NotNull BinaryInput is)
  {
    WriteStream out = env.getOut();
    TempBuffer tempBuf = TempBuffer.allocate();
    byte[] buffer = tempBuf.getBuffer();

    int length = 0;
    try {
      int sublen = is.read(buffer, 0, buffer.length);
      while (sublen > 0) {
View Full Code Here

   */
  public Value gzcompress(Env env,
        InputStream data,
                          @Optional("6") int level)
  {
    TempBuffer tempBuf = TempBuffer.allocate();
    byte []buffer = tempBuf.getBuffer();

    Deflater deflater = null;
   
    try {
      deflater = new Deflater(level, true);
View Full Code Here

   */
  public Value gzuncompress(Env env,
          InputStream is,
                            @Optional("0") long length)
  {
    TempBuffer tempBuf = TempBuffer.allocate();
    byte []buffer = tempBuf.getBuffer();

    InflaterInputStream in = null;
    try {
      if (length == 0)
        length = Long.MAX_VALUE;
View Full Code Here

   * @return compressed using DEFLATE algorithm
   */
  public Value gzdeflate(Env env, InputStream data,
                         @Optional("6") int level)
  {
    TempBuffer tempBuf = TempBuffer.allocate();
    byte []buffer = tempBuf.getBuffer();
    Deflater deflater = null;
   
    try {
      deflater = new Deflater(level, true);

View Full Code Here

TOP

Related Classes of com.caucho.vfs.TempBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.