@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) @NotThreadSafe public class ByteArrayIOEntry extends Object implements IOEntry<ByteArrayIOEntry>
| Modifier and Type | Class and Description |
|---|---|
private class |
ByteArrayIOEntry.ByteArrayInputSocket |
private class |
ByteArrayIOEntry.ByteArrayOutputSocket |
private class |
ByteArrayIOEntry.DataInputChannel |
private class |
ByteArrayIOEntry.DataInputStream |
private class |
ByteArrayIOEntry.DataOutputChannel |
private class |
ByteArrayIOEntry.DataOutputStream |
private class |
ByteArrayIOEntry.DataReadOnlyFile |
private class |
ByteArrayIOEntry.Nio2ByteArrayInputSocket |
private class |
ByteArrayIOEntry.Nio2ByteArrayOutputSocket |
private static class |
ByteArrayIOEntry.SocketFactory |
Entry.Access, Entry.Size, Entry.Type| Modifier and Type | Field and Description |
|---|---|
private byte[] |
data |
private static ByteArrayIOEntry.SocketFactory |
FACTORY |
(package private) int |
initialCapacity |
private String |
name |
private int |
reads |
private EnumMap<Entry.Access,Long> |
times |
private int |
writes |
ALL_ACCESS_SET, ALL_SIZE_SET, ALL_TYPE_SET, DIRECTORY_TYPE_SET, FILE_TYPE_SET, SPECIAL_TYPE_SET, SYMLINK_TYPE_SET, UNKNOWN| Constructor and Description |
|---|
ByteArrayIOEntry(String name)
Equivalent to
new ByteArrayIOPool(name, 32). |
ByteArrayIOEntry(String name,
int initialCapacity)
Constructs a new byte array I/O entry with the given name and initial
capacity of the byte array for the next output to this I/O entry.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCount(Entry.Access type) |
byte[] |
getData()
Returns the byte array for input from this I/O entry.
|
InputSocket<ByteArrayIOEntry> |
getInputSocket()
Returns an input socket for reading this entry.
|
String |
getName()
Returns the entry name.
|
OutputSocket<ByteArrayIOEntry> |
getOutputSocket()
Returns an output socket for writing this entry.
|
long |
getSize(Entry.Size type)
Returns the size of the given type for this entry.
|
long |
getTime(Entry.Access type)
Returns the time of the given access type for this entry.
|
void |
setData(byte[] data)
Sets the byte array for input from this I/O entry.
|
void |
setInitialCapacity(int initialCapacity)
Sets the initial capacity of the byte array for the next output to this
I/O entry.
|
String |
toString() |
@Nullable private byte[] data
private static final ByteArrayIOEntry.SocketFactory FACTORY
int initialCapacity
private final String name
private int reads
private final EnumMap<Entry.Access,Long> times
private int writes
public ByteArrayIOEntry(String name)
new ByteArrayIOPool(name, 32).public ByteArrayIOEntry(String name, int initialCapacity)
name - the name of this entry.initialCapacity - the initial capacity of the array to use for
the next output to this I/O entry.public int getCount(Entry.Access type)
@CheckForNull public byte[] getData()
null.
Note that the returned array is not copied, so beware of
concurrent modifications!public InputSocket<ByteArrayIOEntry> getInputSocket()
InputEntryIOSocket.getLocalTarget() of the returned socket
must return this entry.getInputSocket in interface InputEntry<ByteArrayIOEntry>public final String getName()
EntryEntryName.SEPARATOR_CHAR).
This implies that a segment cannot contain separator characters.
".") or
dot-dot ("..") segments which represent the current or
parent segment respectively.
"foo/bar/" and
"./abc/../foo/./def/./../bar/." both refer to the same entry
when being parsed.getName in interface EntryEntryName.create(String)public OutputSocket<ByteArrayIOEntry> getOutputSocket()
OutputEntryIOSocket.getLocalTarget() of the returned socket
must return this entry.getOutputSocket in interface OutputEntry<ByteArrayIOEntry>public long getSize(Entry.Size type)
EntryEntry.Type.FILE entries.getSize in interface Entrytype - the type of the size to return.Entry.UNKNOWN if not specified or the type is unsupported.public long getTime(Entry.Access type)
Entrypublic void setData(@CheckForNull byte[] data)
data - the byte array for input from this I/O entry.public final void setInitialCapacity(int initialCapacity)
initialCapacity - the initial capacity of the array to use for
the next output to this I/O entry.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.