db.write( data, 0, chunk );
}
// trim the array - the buffer in DataBuffer grows
// past the size and fills with empty chars
db.trim();
// synchronize this block to avoid race conditions with the queue
synchronized( messageQueue ) {
// Create push object, add to queue for callback thread
PushData pd = new PushData( conn, inputStream, db.getArray() );