code: private boolean checkForMagicBytes(int firstByte) throws IOException {
  	byte[] fullMagic=null;
  		for (int i=0;i<this.specificMagicByteArray.length;i++) {
  			// compare first byte and decide if we want to read full magic
  			int currentMagicFirstbyte=this.specificMagicByteArray[i][0] & 0xFF;
  			if (firstByte==currentMagicFirstbyte) {
  				if (fullMagic==null) { // read full magic
  					fullMagic=new byte[4];
  					fullMagic[0]=this.specificMagicByteArray[i][0];
  					int maxByteRead=4;
  					int totalByteRead=1;
  					int readByte;
  					while ((readByte=this.bin.read(fullMagic,totalByteRead,maxByteRead-totalByteRead))>-1) {
  							totalByteRead+=readByte;
  							if (totalByteRead>=maxByteRead) {
  								break;
  							}
  					}
  					if (totalByteRead!=maxByteRead) {
  						return false;
  					} 
  				}
  				// compare full magics
  				if (BitcoinUtil.compareMagics(fullMagic,this.specificMagicByteArray[i])) {
  					this.bin.reset();
  					return true;
  				}
  			}
  				
  			} 
  	return false;
  }
docs: Checks in BufferedInputStream (bin) for the magic(s) specified in specificMagicByteArray
  
  @param firstByte first byte (as int) of the byteBuffer
  
  @retrun true if one of the magics has been identified, false if not
  
  @throws java.io.IOException in case of issues reading from BufferedInputStream