public static StringBlock read(ExtDataInput reader) throws IOException {
  reader.skipCheckChunkTypeInt(CHUNK_STRINGPOOL_TYPE,CHUNK_NULL_TYPE);
  int chunkSize=reader.readInt();
  int stringCount=reader.readInt();
  int styleCount=reader.readInt();
  int flags=reader.readInt();
  int stringsOffset=reader.readInt();
  int stylesOffset=reader.readInt();
  StringBlock block=new StringBlock();
  block.m_isUTF8=(flags & UTF8_FLAG) != 0;
  block.m_stringOffsets=reader.readIntArray(stringCount);
  block.m_stringOwns=new int[stringCount];
  Arrays.fill(block.m_stringOwns,-1);
  if (styleCount != 0) {
    block.m_styleOffsets=reader.readIntArray(styleCount);
  }
{
    int size=((stylesOffset == 0) ? chunkSize : stylesOffset) - stringsOffset;
    if ((size % 4) != 0) {
      throw new IOException("String data size is not multiple of 4 (" + size + ").");
    }
    block.m_strings=new byte[size];
    reader.readFully(block.m_strings);
  }
  if (stylesOffset != 0) {
    int size=(chunkSize - stylesOffset);
    if ((size % 4) != 0) {
      throw new IOException("Style data size is not multiple of 4 (" + size + ").");
    }
    block.m_styles=reader.readIntArray(size / 4);
  }
  return block;
}

public static StringBlock read ( ExtDataInput reader ) throws IOException { reader . skipCheckChunkTypeInt ( CHUNK_STRINGPOOL_TYPE , CHUNK_NULL_TYPE ) ; int chunkSize = reader . readInt ( ) ; int stringCount = reader . readInt ( ) ; int styleCount = reader . readInt ( ) ; int flags = reader . readInt ( ) ; int stringsOffset = reader . readInt ( ) ; int stylesOffset = reader . readInt ( ) ; StringBlock block = new StringBlock ( ) ; block . m_isUTF8 = ( flags & UTF8_FLAG ) != 0 ; block . m_stringOffsets = reader . readIntArray ( stringCount ) ; block . m_stringOwns = new int [ stringCount ] ; Arrays . fill ( block . m_stringOwns , - 1 ) ; if ( styleCount != 0 ) { block . m_styleOffsets = reader . readIntArray ( styleCount ) ; } { int size = ( ( stylesOffset == 0 ) ? chunkSize : stylesOffset ) - stringsOffset ; if ( ( size % 4 ) != 0 ) { throw new IOException ( "String data size is not multiple of 4 (" + size + ")." ) ; } block . m_strings = new byte [ size ] ; reader . readFully ( block . m_strings ) ; } if ( stylesOffset != 0 ) { int size = ( chunkSize - stylesOffset ) ; if ( ( size % 4 ) != 0 ) { throw new IOException ( "Style data size is not multiple of 4 (" + size + ")." ) ; } block . m_styles = reader . readIntArray ( size / 4 ) ; } return block ; }
reads whole ( including chunk type ) string block from stream . stream must be at the chunk type .
