com.perforce.p4java.impl.mapbased.rpc.sys
Class RpcLineEndFilterInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.perforce.p4java.impl.mapbased.rpc.sys.RpcLineEndFilterInputStream
All Implemented Interfaces:
Closeable

public class RpcLineEndFilterInputStream
extends FilterInputStream

Filter input stream to do Perforce-specific line end munging where necessary. This is a lot more complicated that you might think, given the potential for cross-packet and cross-read multibyte end of line spanning.

FIXME: implement "share" mode -- HR. FIXME: unicode version -- HR.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
RpcLineEndFilterInputStream(InputStream inStream, ClientLineEnding lineEnding)
           
 
Method Summary
 int available()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
          Convenience method; equivalent to read(b, 0, b.length).
 int read(byte[] targetBytes, int off, int len)
          Read from the associated input stream looking for end of line strings to replace with the Perforce server newline character.
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.FilterInputStream
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcLineEndFilterInputStream

public RpcLineEndFilterInputStream(InputStream inStream,
                                   ClientLineEnding lineEnding)
Method Detail

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] targetBytes,
                int off,
                int len)
         throws IOException
Read from the associated input stream looking for end of line strings to replace with the Perforce server newline character.

Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Convenience method; equivalent to read(b, 0, b.length).

Overrides:
read in class FilterInputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class FilterInputStream
Throws:
IOException

mark

public void mark(int readlimit)
Overrides:
mark in class FilterInputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class FilterInputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class FilterInputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class FilterInputStream
Throws:
IOException


Copyright © 2015 Perforce Software. All Rights Reserved.