|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.Text
public class Text
A makumba text, a byte array that can be converted to String when needed. When texts get big, they are swapped on
disk. Text swapping is logged (see Logger
,
MakumbaSystem.setLoggingRoot(java.lang.String)
in the logger "abstr.longContent"
with Level.FINE
logging level.
Field Summary | |
---|---|
static int |
FILE_LIMIT
|
(package private) LongData |
ld
|
(package private) int |
len
|
(package private) InputStream |
source
|
Constructor Summary | |
---|---|
Text(byte[] b)
make a Text from the given byte array. |
|
Text(byte[] b,
int start,
int length)
make a Text from the given byte array. |
|
Text(InputStream is)
make a Text by reading the input stream. |
|
Text(InputStream is,
int length)
make a Text from the given input stream, with the given length The content in the input stream must match the length. |
|
Text(String s)
make a Text from the String. |
Method Summary | |
---|---|
boolean |
compare(InputStream is)
compare the content to the content of a given stream, and closes the stream |
boolean |
equals(Object other)
Indicates whether the other object is "equal to" this Text. |
String |
getString()
gets this Text as a String, which is potentially harmful for memory |
static Text |
getText(Object value)
convenience method for making a text out of another Text, InputStream, String, or byte[] |
int |
length()
|
InputStream |
toBinaryStream()
Read the text content as a binary stream. |
String |
toShortString(int length)
|
String |
toString()
converts the text content to a string |
void |
writeTo(OutputStream o)
write content to the given output stream |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
InputStream source
int len
LongData ld
public static int FILE_LIMIT
Constructor Detail |
---|
public Text(InputStream is, int length)
public Text(InputStream is)
public Text(String s)
public Text(byte[] b)
public Text(byte[] b, int start, int length)
Method Detail |
---|
public InputStream toBinaryStream()
public int length()
public static Text getText(Object value)
public String toString()
toString
in class Object
public String toShortString(int length)
public void writeTo(OutputStream o) throws IOException
IOException
public boolean compare(InputStream is) throws IOException
IOException
public boolean equals(Object other)
equals
in class Object
public String getString()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |