public final class IoBridge
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
checkOffsetAndCount(int arrayLength,
int offset,
int count)
Checks that the range described by
offset and count doesn't exceed
arrayLength . |
static FileDescriptor |
open(java.lang.String path,
int flags)
java.io only throws FileNotFoundException when opening files, regardless of what actually
went wrong.
|
static int |
read(FileDescriptor fd,
byte[] bytes,
int byteOffset,
int byteCount)
java.io thinks that a read at EOF is an error and should return -1, contrary to traditional
Unix practice where you'd read until you got 0 bytes (and any future read would return -1).
|
static void |
write(FileDescriptor fd,
byte[] bytes,
int byteOffset,
int byteCount,
int flags)
java.io always writes every byte it's asked to, or fails with an error.
|
public static void checkOffsetAndCount(int arrayLength, int offset, int count)
offset
and count
doesn't exceed
arrayLength
.
This is from Android's java.util.Arrays.public static FileDescriptor open(java.lang.String path, int flags) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws java.io.IOException
java.io.IOException
public static void write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags) throws java.io.IOException
java.io.IOException