public String getString ( Charset charset ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; byte cc = get ( ) ; while ( cc != 0 ) { baos . write ( cc ) ; cc = get ( ) ; } byte [ ] buf = baos . toByteArray ( ) ; return new String ( buf , charset ) ; }
returns null terminated string