Package org.apache.mina.core.buffer

Examples of org.apache.mina.core.buffer.IoBuffer.free()


    tmp.flip();

    // Store size and parameters
    result.putInt(tmp.limit());
    result.put(tmp);
    tmp.free();
    tmp = null;

    result.flip();
    return result;
  }
View Full Code Here


    } finally {
      if (resultBuffer != null) {
        resultBuffer.free();
        resultBuffer = null;
      }
      data.free();
      data = null;
    }
    return null;
  }
View Full Code Here

      final IoBuffer localData = data;
      // null out the data first so we don't accidentally
      // return a valid reference first
      data = null;
      localData.clear();
      localData.free();
    }
  }

  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
View Full Code Here

      } catch (IOException e) {
        log.error("Error writing tag", e);
      } finally {
        if (data != null) {
          data.clear();
          data.free();
        }
      }
    }
    data = null;
  }
View Full Code Here

            log.error("The writer is no longer able to write to the file: {} writable: {}", file.getName(), file.canWrite());
          }
        } finally {
          if (data != null) {
            data.clear();
            data.free();
          }
        }
      }
      data = null;
      queued.dispose();
View Full Code Here

            return null;
          }
          result.deserialize(in);
        }
      } finally {
        buf.free();
        buf = null;
      }
      if (result.getStore() != this) {
        result.setStore(this);
      }
View Full Code Here

    bytes[3] = rev.get();
    bytes[2] = rev.get();
    bytes[1] = rev.get();
    bytes[0] = rev.get();
    out.put(bytes);
    rev.free();
    rev = null;
  }

    /**
     * Writes reversed integer to buffer.
View Full Code Here

    buf.put(in.get());
    buf.put(in.get());
    buf.put(in.get());
    buf.flip();
    int value = buf.getInt();
    buf.free();
    buf = null;
    return value;
  }

    /**
 
View Full Code Here

    int length = req.getContentLength();
    log.trace("Skipping {} bytes", length);
    IoBuffer data = IoBuffer.allocate(length);
    ServletUtils.copy(req, data.asOutputStream());
    data.flip();
    data.free();
    data = null;
    log.trace("Skipped {} bytes", length);
  }

  /**
 
View Full Code Here

      ServletUtils.copy(req, data.asOutputStream());
      data.flip();
      // decode the objects in the data
      final List<?> messages = conn.decode(data);
      // clear the buffer
      data.free();
      // messages are either of IoBuffer or Packet type
      // handshaking uses IoBuffer and everything else should be Packet
      for (Object message : messages) {
        conn.handleMessageReceived(message);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.