Examples of BoundedInputStream


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

        parseMessage();
        long limit = getBodyStartOctet() -2;
        if (limit < 0) {
            limit = 0;
        }
        return new BoundedInputStream(getFullContent(), limit);

    }
View Full Code Here

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

     */
    public InputStream getInputStream() throws IOException {
        // wrap the streams in a BoundedInputStream to make sure it really match with the stored size.
        switch (type) {
        case Full:
            return new BoundedInputStream(ResultUtils.toInput(m), size());
        default:
            return new BoundedInputStream(m.getBodyContent(), size());
        }
      
    }
View Full Code Here

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

    public InputStream getHeaderContent() throws IOException {
        long limit = getBodyStartOctet() -2;
        if (limit < 0) {
            limit = 0;
        }
        return new BoundedInputStream(getFullContent(), limit);
    }
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

        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

  @Override
  public InputStream getInputStream() throws IOException {
    FSDataInputStream inputStream = localFS.open(inputFile);
    inputStream.seek(startOffset);
    return new BoundedInputStream(inputStream, compressedSize);
  }
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

        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
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.