Examples of BoundedInputStream


Examples of org.apache.commons.io.input.BoundedInputStream

      try {
        String logType = valueStream.readUTF();
        String logLengthStr = valueStream.readUTF();
        currentLogLength = Long.parseLong(logLengthStr);
        currentLogData =
            new BoundedInputStream(valueStream, currentLogLength);
        currentLogData.setPropagateClose(false);
        currentLogISR = new InputStreamReader(currentLogData);
        currentLogType = logType;
      } catch (EOFException e) {
      }
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

          @Override
          public InputStream getInputStream() throws ResourceStreamNotFoundException {
            if (bi == null) {
              //bi = new BoundedInputStream(super.getInputStream(), end + 1);
              bi = new BoundedInputStream(super.getInputStream(), isRange ? end + 1 : (file == null ? -1 : file.length()));
              try {
                bi.skip(start);
              } catch (IOException e) {
                throw new ResourceStreamNotFoundException(e);
              }
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

    final long streamlength = Long.parseLong(cl);
    filelength = startPos + streamlength;
    // Java has a bug with >2GB request streams.  It won't bounds check
    // the reads so the transfer blocks until the server times out
    InputStream is =
        new BoundedInputStream(connection.getInputStream(), streamlength);

    resolvedURL.setURL(getResolvedUrl(connection));
   
    return is;
  }
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

          @Override
          public InputStream getInputStream() throws ResourceStreamNotFoundException {
            if (bi == null) {
              //bi = new BoundedInputStream(super.getInputStream(), end + 1);
              bi = new BoundedInputStream(super.getInputStream(), isRange ? end + 1 : (file == null ? -1 : file.length()));
              try {
                bi.skip(start);
              } catch (IOException e) {
                throw new ResourceStreamNotFoundException(e);
              }
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

      final long streamlength = Long.parseLong(cl);
      fileLength = startPos + streamlength;

      // Java has a bug with >2GB request streams.  It won't bounds check
      // the reads so the transfer blocks until the server times out
      in = new BoundedInputStream(in, streamlength);
    }

    return in;
  }
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

        writer.write(fileType);
        writer.write("\nLogLength:");
        writer.write(fileLengthStr);
        writer.write("\nLog Contents:\n");
        // ByteLevel
        BoundedInputStream bis =
            new BoundedInputStream(valueStream, fileLength);
        InputStreamReader reader = new InputStreamReader(bis);
        int currentRead = 0;
        int totalRead = 0;
        while ((currentRead = reader.read(cbuf, 0, bufferSize)) != -1) {
          writer.write(cbuf, 0, currentRead);
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

      try {
        String logType = valueStream.readUTF();
        String logLengthStr = valueStream.readUTF();
        currentLogLength = Long.parseLong(logLengthStr);
        currentLogData =
            new BoundedInputStream(valueStream, currentLogLength);
        currentLogData.setPropagateClose(false);
        currentLogISR = new InputStreamReader(currentLogData);
        currentLogType = logType;
      } catch (EOFException e) {
      }
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

      final long streamlength = Long.parseLong(cl);
      fileLength = startPos + streamlength;

      // Java has a bug with >2GB request streams.  It won't bounds check
      // the reads so the transfer blocks until the server times out
      in = new BoundedInputStream(in, streamlength);
    }

    return in;
  }
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

        writer.write(fileType);
        writer.write("\nLogLength:");
        writer.write(fileLengthStr);
        writer.write("\nLog Contents:\n");
        // ByteLevel
        BoundedInputStream bis =
            new BoundedInputStream(valueStream, fileLength);
        InputStreamReader reader = new InputStreamReader(bis);
        int currentRead = 0;
        int totalRead = 0;
        while ((currentRead = reader.read(cbuf, 0, bufferSize)) != -1) {
          writer.write(cbuf, 0, currentRead);
View Full Code Here

Examples of org.apache.commons.io.input.BoundedInputStream

      try {
        String logType = valueStream.readUTF();
        String logLengthStr = valueStream.readUTF();
        currentLogLength = Long.parseLong(logLengthStr);
        currentLogData =
            new BoundedInputStream(valueStream, currentLogLength);
        currentLogData.setPropagateClose(false);
        currentLogISR = new InputStreamReader(currentLogData);
        currentLogType = logType;
      } catch (EOFException e) {
      }
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.