Methods Summary |
---|
protected void | fillFields(org.apache.poi.hssf.record.RecordInputStream in)
byte[] data = in.readRemainder();
//The string is always 112 characters (padded with spaces), therefore
//this record can not be continued.
//What a wierd record, it is not really a unicode string because the
//header doesnt provide a correct size indication.???
//But the header is present, so we need to skip over it.
//Odd, Odd, Odd ;-)
field_1_username = StringUtil.getFromCompressedUnicode(data, 3, data.length - 3);
|
public int | getRecordSize()
return 116;
|
public short | getSid()
return sid;
|
public java.lang.String | getUsername()get the username for the user that created the report. HSSF uses the logged in user. On
natively created M$ Excel sheet this would be the name you typed in when you installed it
in most cases.
return field_1_username;
|
public int | serialize(int offset, byte[] data)
String username = getUsername();
StringBuffer temp = new StringBuffer(0x70 - (0x3));
temp.append(username);
while (temp.length() < 0x70 - 0x3)
{
temp.append(
" "); // (70 = fixed lenght -3 = the overhead bits of unicode string)
}
username = temp.toString();
UnicodeString str = new UnicodeString(username);
str.setOptionFlags(( byte ) 0x0);
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset, (short)112); // 112 bytes (115 total)
UnicodeString.UnicodeRecordStats stats = new UnicodeString.UnicodeRecordStats();
stats.recordSize += 4;
stats.remainingSize-= 4;
str.serialize(stats, 4 + offset, data);
return getRecordSize();
|
public void | setUsername(java.lang.String username)set the username for the user that created the report. HSSF uses the logged in user.
field_1_username = username;
|
public java.lang.String | toString()
StringBuffer buffer = new StringBuffer();
buffer.append("[WRITEACCESS]\n");
buffer.append(" .name = ")
.append(field_1_username.toString()).append("\n");
buffer.append("[/WRITEACCESS]\n");
return buffer.toString();
|
protected void | validateSid(short id)
if (id != sid)
{
throw new RecordFormatException("NOT A WRITEACCESS RECORD");
}
|