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.void
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 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.boolean
isOpen()
Deprecated.True if the pipe is openboolean
Deprecated.True if this pipe is readableboolean
Deprecated.True if this pipe is writableint
read
(byte[] dst) Deprecated.Read from the pipe.int
read
(byte[] dst, int offset, int length) Deprecated.Read from the pipe.int
read
(ByteBuffer dst) Deprecated.Read from the pipe.int
read
(CharBuffer cb) Deprecated.int
read
(CharBuffer cb, String charset) Deprecated.void
reset()
Deprecated.Reset the pipe.int
write
(byte[] src) Deprecated.Write to the pipeint
write
(byte[] src, int offset, int len) Deprecated.Write to the pipeint
write
(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:
read
in 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:
write
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
reset
public void reset()Deprecated.Reset the pipe. Switches the pipe to writable mode -
append
Deprecated.- Specified by:
append
in interfaceAppendable
- Throws:
IOException
-
append
Deprecated.- Specified by:
append
in interfaceAppendable
- Throws:
IOException
-
append
Deprecated.- Specified by:
append
in interfaceAppendable
- Throws:
IOException
-
append
Deprecated.- Throws:
IOException
-
append
Deprecated.- Throws:
IOException
-
append
Deprecated.- Throws:
IOException
-
read
Deprecated.- Specified by:
read
in interfaceReadable
- Throws:
IOException
-
read
Deprecated.- Throws:
IOException
-