public static FlacMetadataBlock create(InputStream inp) throws IOException {
      int typeI = inp.read();
      if(typeI == -1) {
         throw new IllegalArgumentException();
      }
      byte type = IOUtils.fromInt(typeI);
      
      byte[] l = new byte[3];
      IOUtils.readFully(inp, l);
      int length = (int)IOUtils.getInt3BE(l);
      
      byte[] data = new byte[length];
      IOUtils.readFully(inp, data);
      
      switch(type) {
         case STREAMINFO:
            return new FlacInfo(data, 0);
         case VORBIS_COMMENT:
            return new FlacTags.FlacTagsAsMetadata(data);
         default:
            return new FlacUnhandledMetadataBlock(type, data);
      }
   }