Modifier and Type | Method and Description |
---|---|
static void |
cleanup(Closeable... closeables)
Closes the Closeable objects and ignore any
IOException or
null pointers. |
static void |
closeQuietly(Closeable closeable)
Closes the given
Closeable quietly by ignoring IOException. |
static void |
readFully(Input in,
long position,
byte[] buffer,
int offset,
int length)
Does the readFully based on Input's positioned read.
|
static void |
readFully(InputStream in,
byte[] buf,
int off,
int len)
Does the readFully based on the Input read.
|
public static void cleanup(Closeable... closeables)
IOException
or
null pointers. Must only be used for cleanup in exception handlers.closeables
- the objects to close.public static void closeQuietly(Closeable closeable)
Closeable
quietly by ignoring IOException.closeable
- The resource to close.public static void readFully(Input in, long position, byte[] buffer, int offset, int length) throws IOException
in
- the input source.position
- the given position.buffer
- the buffer to be read.length
- the maximum number of bytes to read.offset
- the start offset in array buffer.IOException
- if an I/O error occurs.public static void readFully(InputStream in, byte[] buf, int off, int len) throws IOException
in
- the input stream of bytes.buf
- the buffer to be read.off
- the start offset in array buffer.len
- the maximum number of bytes to read.IOException
- if an I/O error occurs.Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.