code: public int readChar()
          throws IOException
      {
          if (_chunkLength > 0) {
              _chunkLength--;
              if (_chunkLength == 0 && _isLastChunk)
                  _chunkLength = END_OF_DATA;
  
              int ch = parseUTF8Char();
              return ch;
          }
          else if (_chunkLength == END_OF_DATA) {
              _chunkLength = 0;
              return -1;
          }
  
          int tag = read();
  
          switch (tag) {
              case 'N':
                  return -1;
  
              case 'S':
              case 's':
              case 'X':
              case 'x':
                  _isLastChunk = tag == 'S' || tag == 'X';
                  _chunkLength = (read() << 8) + read();
  
                  _chunkLength--;
                  int value = parseUTF8Char();
  
                  // special code so successive read byte won't
                  // be read as a single object.
                  if (_chunkLength == 0 && _isLastChunk)
                      _chunkLength = END_OF_DATA;
  
                  return value;
  
              default:
                  throw new IOException("expected 'S' at " + (char) tag);
          }
      }
docs: Reads a byte from the stream.