public static Sample loadBinary(ByteBuffer bb) throws IOException {
  int frameDataSize=bb.getInt();
  short[] frameData=new short[frameDataSize];
  for (int i=0; i < frameData.length; i++) {
    frameData[i]=bb.getShort();
  }
  int residualDataSize=bb.getInt();
  byte[] residualData=new byte[residualDataSize];
  for (int i=0; i < residualData.length; i++) {
    residualData[i]=bb.get();
  }
  return new Sample(frameData,residualData,residualDataSize);
}

public static Sample loadBinary ( ByteBuffer bb ) throws IOException { int frameDataSize = bb . getInt ( ) ; short [ ] frameData = new short [ frameDataSize ] ; for ( int i = 0 ; i < frameData . length ; i ++ ) { frameData [ i ] = bb . getShort ( ) ; } int residualDataSize = bb . getInt ( ) ; byte [ ] residualData = new byte [ residualDataSize ] ; for ( int i = 0 ; i < residualData . length ; i ++ ) { residualData [ i ] = bb . get ( ) ; } return new Sample ( frameData , residualData , residualDataSize ) ; }
loads the samples from the byte bufer
