Examples of SizeLimitInputStream


Examples of net.pms.io.SizeLimitInputStream

   */
  private InputStream wrap(InputStream input, long high, long low) {
    if (input != null && high > low) {
      long bytes = (high - (low < 0 ? 0 : low)) + 1;
      LOGGER.trace("Using size-limiting stream (" + bytes + " bytes)");
      return new SizeLimitInputStream(input, bytes);
    }
    return input;
  }
View Full Code Here

Examples of net.pms.io.SizeLimitInputStream

   */
  private InputStream wrap(InputStream input, long high, long low) {
    if (input != null && high > low) {
      long bytes = (high - (low < 0 ? 0 : low)) + 1;
      logger.trace("Using size-limiting stream (" + bytes + " bytes)");
      return new SizeLimitInputStream(input, bytes);
    }
    return input;
  }
View Full Code Here

Examples of org.nasutekds.server.util.SizeLimitInputStream

    {
      if(!streamStack.isEmpty())
      {
        // We are reading a sub sequence. Return true as long as we haven't
        // exausted the size limit for the sub sequence sub input stream.
        SizeLimitInputStream subSq = (SizeLimitInputStream)in;
        return (subSq.getSizeLimit() - subSq.getBytesRead() > 0);
      }

      return state != ELEMENT_READ_STATE_NEED_TYPE ||
          needTypeState(true, false);
    }
View Full Code Here

Examples of org.nasutekds.server.util.SizeLimitInputStream

  public void readStartSequence() throws ASN1Exception
  {
    // Read the header if haven't done so already
    peekLength();

    SizeLimitInputStream subStream =
        new SizeLimitInputStream(in, peekLength);

    if(debugEnabled())
    {
      TRACER.debugProtocolElement(DebugLogLevel.VERBOSE,
          String.format("READ ASN.1 SEQUENCE(type=0x%x, length=%d)",
View Full Code Here

Examples of org.nasutekds.server.util.SizeLimitInputStream

      Message message = ERR_ASN1_SEQUENCE_READ_NOT_STARTED.get();
      throw new ASN1Exception(message);
    }

    // Ignore all unused trailing components.
    SizeLimitInputStream subSq = (SizeLimitInputStream)in;
    if(subSq.getSizeLimit() - subSq.getBytesRead() > 0)
    {
      if(debugEnabled())
      {
        TRACER.debugWarning("Ignoring %d unused trailing bytes in " +
            "ASN.1 SEQUENCE", subSq.getSizeLimit() - subSq.getBytesRead());
      }

      try
      {
        subSq.skip(subSq.getSizeLimit() - subSq.getBytesRead());
      }
      catch(IOException ioe)
      {
        Message message =
            ERR_ASN1_READ_ERROR.get(ioe.toString());
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.