Code example for ByteChannel

Methods: write

0
//			//tempBuffer.flip(); 
//			//System.out.println("Padding with " + tempBuffer.limit()); 
//			this.innerChannel.write(tempBuffer); 
//			totalBytesWritten = 0; 
//		} 
		int bytesWritten = this.innerChannel.write(src);
		if (this.paddedBlocks){
			totalBytesWritten += bytesWritten;
		} 
		return bytesWritten;
	} 
	 
	public int writeWithPadding(ByteBuffer src, int bytesToBeWritten) throws IOException {
		//int bytesToBeWritten = src.limit(); 
		//System.out.println("Bytes to be written: " + bytesToBeWritten); 
		long totalBytesToBeWritten = this.totalBytesWritten + bytesToBeWritten;
		if (this.paddedBlocks && totalBytesToBeWritten > this.blockSize){
			//System.out.println("block-total: " + this.blockSize + " - " + totalBytesWritten); 
			int padd = this.blockSize - this.totalBytesWritten;
			System.out.println(padd);
Connect your IDE to all the code out there  Get Codota for Java