public class Field extends PadJustifyFieldSupport
PadJustifyFieldSupport.Justify
FieldSupport.Overflow, FieldSupport.Underflow
DEFAULT_PAD
Constructor and Description |
---|
Field(byte[] buffer)
Create and initialize a new Field.
|
Field(int size)
Create a new Field.
|
Modifier and Type | Method and Description |
---|---|
Field |
clone()
Clone oneself.
|
FieldSupport.Overflow |
getOverflow()
Get the overflow.
|
protected int |
getPadJustifyLength()
Provide the desired target length for padding/justification actions.
|
byte[] |
getValue()
Get the value of this Entity.
|
int |
length()
Get the length of this Entity.
|
void |
readFrom(InputStream is)
Read value from an InputStream.
|
void |
setOverflow(FieldSupport.Overflow overflow)
Set the overflow.
|
void |
setValue(byte[] b)
Implement pad/justify.
|
void |
writeTo(OutputStream os)
Write value to an OutputStream.
|
getJustify, getPad, setJustify, setPad
dieOnExceptionRead
fill, getValue, setValue
public Field(int size)
size
- of fieldpublic Field(byte[] buffer)
buffer
- byte[] which is not copied, but used directly.public int length()
public void readFrom(InputStream is) throws IOException
is
- to readIOException
- on errorpublic void writeTo(OutputStream os) throws IOException
os
- to write toIOException
- on errorpublic void setValue(byte[] b)
setValue
in interface Entity
setValue
in class PadJustifyFieldSupport
b
- value setpublic byte[] getValue()
public Field clone()
clone
in interface Entity
clone
in class EntitySupport
public FieldSupport.Overflow getOverflow()
public void setOverflow(FieldSupport.Overflow overflow)
overflow
- Overflowprotected int getPadJustifyLength()
getPadJustifyLength
in class PadJustifyFieldSupport
Copyright © 2008-2016 The Apache Software Foundation. All Rights Reserved.