Package ch.bailu.gtk.gio
Klasse BufferedInputStream
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gio.InputStream
ch.bailu.gtk.gio.FilterInputStream
ch.bailu.gtk.gio.BufferedInputStream
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
DataInputStream
Buffered input stream implements [class@Gio.FilterInputStream] and provides
for buffered reads.
By default, `GBufferedInputStream`'s buffer size is set at 4 kilobytes.
To create a buffered input stream, use [ctor@Gio.BufferedInputStream.new],
or [ctor@Gio.BufferedInputStream.new_sized] to specify the buffer's size at
construction.
To get the size of a buffer within a buffered input stream, use
[method@Gio.BufferedInputStream.get_buffer_size]. To change the size of a
buffered input stream's buffer, use [method@Gio.BufferedInputStream.set_buffer_size].
Note that the buffer's size cannot be reduced below the size of the data within the buffer.
for buffered reads.
By default, `GBufferedInputStream`'s buffer size is set at 4 kilobytes.
To create a buffered input stream, use [ctor@Gio.BufferedInputStream.new],
or [ctor@Gio.BufferedInputStream.new_sized] to specify the buffer's size at
construction.
To get the size of a buffer within a buffered input stream, use
[method@Gio.BufferedInputStream.get_buffer_size]. To change the size of a
buffered input stream's buffer, use [method@Gio.BufferedInputStream.set_buffer_size].
Note that the buffer's size cannot be reduced below the size of the data within the buffer.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungBufferedInputStream
(InputStream base_stream) Creates a new [class@Gio.InputStream] from the given @base_stream, with
a buffer set to the default size (4 kilobytes).BufferedInputStream
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungImplements interfaceSeekable
.long
fill
(long count, Cancellable cancellable) Tries to read @count bytes from the stream into the buffer.void
fillAsync
(long count, int io_priority, Cancellable cancellable, BufferedInputStream.OnAsyncReadyCallback callback, Pointer user_data) Reads data into @stream's buffer asynchronously, up to @count size.long
fillFinish
(AsyncResult result) Finishes an asynchronous read.long
Gets the size of the available data within the stream.long
Gets the size of the input buffer.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static BufferedInputStream
newSizedBufferedInputStream
(InputStream base_stream, long size) Creates a new [class@Gio.BufferedInputStream] from the given @base_stream,
with a buffer set to @size.long
Peeks in the buffer, copying data of size @count into @buffer,
offset @offset bytes.peekBuffer
(Int64 count) Returns the buffer with the currently available bytes.int
readByte
(Cancellable cancellable) Tries to read a single byte from the stream or the buffer.void
setBufferSize
(long size) Sets the size of the internal buffer of @stream to @size, or to the
size of the contents of the buffer.Von Klasse geerbte Methoden ch.bailu.gtk.gio.FilterInputStream
getBaseStream, getCloseBaseStream, setCloseBaseStream
Von Klasse geerbte Methoden ch.bailu.gtk.gio.InputStream
clearPending, close, closeAsync, closeFinish, hasPending, isClosed, read, readAll, readAllAsync, readAllFinish, readAsync, readBytes, readBytesAsync, readBytesFinish, readFinish, setPending, skip, skipAsync, skipFinish
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
BufferedInputStream
-
BufferedInputStream
Creates a new [class@Gio.InputStream] from the given @base_stream, with
a buffer set to the default size (4 kilobytes).- Parameter:
base_stream
- a [class@Gio.InputStream]
-
-
Methodendetails
-
getClassHandler
-
newSizedBufferedInputStream
public static BufferedInputStream newSizedBufferedInputStream(@Nonnull InputStream base_stream, long size) Creates a new [class@Gio.BufferedInputStream] from the given @base_stream,
with a buffer set to @size.- Parameter:
base_stream
- a [class@Gio.InputStream]size
- a #gsize- Gibt zurück:
- a [class@Gio.InputStream].
-
fill
Tries to read @count bytes from the stream into the buffer.
Will block during this read.
If @count is zero, returns zero and does nothing. A value of @count
larger than `G_MAXSSIZE` will cause a
[error@Gio.IOErrorEnum.INVALID_ARGUMENT] error.
On success, the number of bytes read into the buffer is returned.
It is not an error if this is not the same as the requested size, as it
can happen e.g. near the end of a file. Zero is returned on end of file
(or if @count is zero), but never otherwise.
If @count is -1 then the attempted read size is equal to the number of
bytes that are required to fill the buffer.
If @cancellable is not `NULL`, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned.
If an operation was partially finished when the operation was cancelled the
partial result will be returned, without an error.
On error `-1` is returned and @error is set accordingly.
For the asynchronous, non-blocking, version of this function, see
[method@Gio.BufferedInputStream.fill_async].- Parameter:
count
- the number of bytes that will be read from the streamcancellable
- optional [class@Gio.Cancellable] object, `NULL` to ignore- Gibt zurück:
- the number of bytes read into @stream's buffer, up to @count, or `-1` on error.
- Löst aus:
AllocationError
-
fillAsync
public void fillAsync(long count, int io_priority, @Nullable Cancellable cancellable, BufferedInputStream.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Reads data into @stream's buffer asynchronously, up to @count size.
@io_priority can be used to prioritize reads. For the synchronous
version of this function, see [method@Gio.BufferedInputStream.fill].
If @count is `-1` then the attempted read size is equal to the number
of bytes that are required to fill the buffer.- Parameter:
count
- the number of bytes that will be read from the streamio_priority
- the [I/O priority](iface.AsyncResult.html#io-priority) of the requestcancellable
- optional [class@Gio.Cancellable] objectcallback
- a [callback@Gio.AsyncReadyCallback]user_data
- a #gpointer
-
fillFinish
Finishes an asynchronous read.- Parameter:
result
- a [iface@Gio.AsyncResult]- Gibt zurück:
- a #gssize of the read stream, or `-1` on an error.
- Löst aus:
AllocationError
-
getAvailable
public long getAvailable()Gets the size of the available data within the stream.- Gibt zurück:
- size of the available stream.
-
getBufferSize
public long getBufferSize()Gets the size of the input buffer.- Gibt zurück:
- the current buffer size.
-
peek
Peeks in the buffer, copying data of size @count into @buffer,
offset @offset bytes.- Parameter:
buffer
- a pointer to an allocated chunk of memoryoffset
- a #gsizecount
- a #gsize- Gibt zurück:
- a #gsize of the number of bytes peeked, or `-1` on error.
-
peekBuffer
Returns the buffer with the currently available bytes. The returned
buffer must not be modified and will become invalid when reading from
the stream or filling the buffer.- Parameter:
count
- a #gsize to get the number of bytes available in the buffer- Gibt zurück:
- read-only buffer
-
readByte
Tries to read a single byte from the stream or the buffer. Will block
during this read.
On success, the byte read from the stream is returned. On end of stream
`-1` is returned but it's not an exceptional error and @error is not set.
If @cancellable is not `NULL`, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned.
If an operation was partially finished when the operation was cancelled the
partial result will be returned, without an error.
On error `-1` is returned and @error is set accordingly.- Parameter:
cancellable
- optional [class@Gio.Cancellable] object, `NULL` to ignore- Gibt zurück:
- the byte read from the @stream, or `-1` on end of stream or error.
- Löst aus:
AllocationError
-
setBufferSize
public void setBufferSize(long size) Sets the size of the internal buffer of @stream to @size, or to the
size of the contents of the buffer. The buffer can never be resized
smaller than its current contents.- Parameter:
size
- a #gsize
-
asSeekable
Implements interfaceSeekable
. Call this to get access to interface functions.- Gibt zurück:
Seekable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-