Package org.apache.abdera.i18n.text.io
Class PipeChannel
java.lang.Object
org.apache.abdera.i18n.text.io.PipeChannel
- All Implemented Interfaces:
Closeable,Appendable,AutoCloseable,Readable,Channel,ReadableByteChannel,WritableByteChannel
@Deprecated(since="2021-07-29")
public class PipeChannel
extends Object
implements ReadableByteChannel, WritableByteChannel, Appendable, Readable, Closeable
Deprecated.
This API is deprecated as Apache Abdera is a retired project since 2017.
Implements a buffer that provides a slightly more efficient way of writing, and then reading a stream of bytes. To
use: PipeChannel pipe = new PipeChannel(); byte[] bytes = {'a','b','c','d'}; pipe.write(bytes); pipe.close();
InputStream in = pipe.getInputStream(); int i = -1; while ((i = in.read()) != -1) {...} By default, closing will
automatically cause it to flip over to Read mode, locking the buffer from further writes and setting the read
position to 0. Once the Buffer has been fully read, it must be reset, which sets it back into write mode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) Deprecated.Deprecated.append(CharSequence csq) Deprecated.append(CharSequence csq, int start, int end) Deprecated.append(CharSequence csq, int start, int end, String charset) Deprecated.append(CharSequence csq, String charset) Deprecated.voidclose()Deprecated.If the pipe is writable, this will close the input and switch to readable mode If the pipe is readable, this will close the output and reset the pipeDeprecated.Get an inputstream that can read from this pipe.Deprecated.Get a CodepointIterator that can iterate over unicode codepoints in this pipe.getIterator(String charset) Deprecated.Get a CodepointIterator that can iterate over unicode codepoints in this pipe.Deprecated.Get an outputstream that can write to this pipe.Deprecated.Get a reader that can reader from this pipe.Deprecated.Get a reader that can reader from this pipe.Deprecated.Get a writer that can write to this pipe.Deprecated.Get a writer that can write to this pipe.booleanisOpen()Deprecated.True if the pipe is openbooleanDeprecated.True if this pipe is readablebooleanDeprecated.True if this pipe is writableintread(byte[] dst) Deprecated.Read from the pipe.intread(byte[] dst, int offset, int length) Deprecated.Read from the pipe.intread(ByteBuffer dst) Deprecated.Read from the pipe.intread(CharBuffer cb) Deprecated.intread(CharBuffer cb, String charset) Deprecated.voidreset()Deprecated.Reset the pipe.intwrite(byte[] src) Deprecated.Write to the pipeintwrite(byte[] src, int offset, int len) Deprecated.Write to the pipeintwrite(ByteBuffer src) Deprecated.Write to the pipe
-
Constructor Details
-
PipeChannel
public PipeChannel()Deprecated. -
PipeChannel
Deprecated.
-
-
Method Details
-
getInputStream
Deprecated.Get an inputstream that can read from this pipe. The Pipe must be readable -
getOutputStream
Deprecated.Get an outputstream that can write to this pipe. The Pipe must be writable -
getWriter
Deprecated.Get a writer that can write to this pipe. The pipe must be writable -
getWriter
Deprecated.Get a writer that can write to this pipe. The pipe must be writable -
getReader
Deprecated.Get a reader that can reader from this pipe. The pipe must be readable -
getReader
Deprecated.Get a reader that can reader from this pipe. The pipe must be readable -
getIterator
Deprecated.Get a CodepointIterator that can iterate over unicode codepoints in this pipe. The pipe must be readable -
getIterator
Deprecated.Get a CodepointIterator that can iterate over unicode codepoints in this pipe. The pipe must be readable -
read
Deprecated.Read from the pipe.- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-
read
Deprecated.Read from the pipe.- Throws:
IOException
-
read
Deprecated.Read from the pipe.- Throws:
IOException
-
isOpen
public boolean isOpen()Deprecated.True if the pipe is open -
write
Deprecated.Write to the pipe- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
write
Deprecated.Write to the pipe- Throws:
IOException
-
write
Deprecated.Write to the pipe- Throws:
IOException
-
isReadable
public boolean isReadable()Deprecated.True if this pipe is readable -
isWritable
public boolean isWritable()Deprecated.True if this pipe is writable -
close
Deprecated.If the pipe is writable, this will close the input and switch to readable mode If the pipe is readable, this will close the output and reset the pipe- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
reset
public void reset()Deprecated.Reset the pipe. Switches the pipe to writable mode -
append
Deprecated.- Specified by:
appendin interfaceAppendable- Throws:
IOException
-
append
Deprecated.- Specified by:
appendin interfaceAppendable- Throws:
IOException
-
append
Deprecated.- Specified by:
appendin interfaceAppendable- Throws:
IOException
-
append
Deprecated.- Throws:
IOException
-
append
Deprecated.- Throws:
IOException
-
append
Deprecated.- Throws:
IOException
-
read
Deprecated.- Specified by:
readin interfaceReadable- Throws:
IOException
-
read
Deprecated.- Throws:
IOException
-