Package io.github.jwharm.javagi.gio
Interface AutoCloseable
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BufferedInputStream
,BufferedOutputStream
,ConverterInputStream
,ConverterOutputStream
,DataInputStream
,DataOutputStream
,FileInputStream
,FileIOStream
,FileOutputStream
,FilterInputStream
,FilterInputStream.FilterInputStream$Impl
,FilterOutputStream
,FilterOutputStream.FilterOutputStream$Impl
,InputStream
,InputStream.InputStream$Impl
,IOStream
,IOStream.IOStream$Impl
,MemoryInputStream
,MemoryOutputStream
,MultipartInputStream
,OutputStream
,OutputStream.OutputStream$Impl
,PollableInputStream.PollableInputStream$Impl
,PollableOutputStream.PollableOutputStream$Impl
,SimpleIOStream
,SocketConnection
,TcpConnection
,TcpWrapperConnection
,TlsClientConnection.TlsClientConnection$Impl
,TlsConnection
,TlsConnection.TlsConnection$Impl
,TlsServerConnection.TlsServerConnection$Impl
,UnixConnection
,UnixInputStream
,UnixOutputStream
,Win32InputStream
,Win32OutputStream
An
AutoCloseable
interface for GIO streams.
This interface extends AutoCloseable
and implements
close()
with a default
method that calls
close(Cancellable)
. This interface is implemented by GIO streams
(IOStream
, InputStream
and OutputStream
) so they
become AutoCloseable
and can be used in a try-with-resources block.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
A default implementation ofAutoCloseable
that callsclose(Cancellable)
.boolean
close
(Cancellable cancellable)
-
Method Details
-
close
A default implementation ofAutoCloseable
that callsclose(Cancellable)
. The return value ofclose(Cancellable)
is ignored.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- AnIOException
that is wrapped around theGErrorException
that is thrown byclose(Cancellable)
.
-
close
- Parameters:
cancellable
- optionalCancellable
object,null
to ignore- Returns:
true
on success,false
on failure- Throws:
GErrorException
- SeeGError
-