/// <summary> /// Puts an in buffer stream onto an out buffer stream and returns the bytes written. /// </summary> /// <param name="output"></param> /// <param name="input"></param> /// <param name="numBytesMax"></param> /// <returns></returns> public static int Put(ByteBuffer output, ByteBuffer input, int numBytesMax) { int limit = input.Limit; int numBytesRead = (numBytesMax > input.Remaining) ? input.Remaining : numBytesMax; /* * input.Limit = (int)input.Position + numBytesRead; * output.Put(input); * input.Limit = limit; */ output.Put(input, numBytesRead); return(numBytesRead); }