Adding support for Utf8Appendable.append(ByteBuffer)

This commit is contained in:
Joakim Erdfelt 2012-08-07 09:53:15 -07:00
parent 75c2b57f25
commit 5a77c0801a
1 changed files with 16 additions and 0 deletions

View File

@ -13,6 +13,7 @@
package org.eclipse.jetty.util;
import java.io.IOException;
import java.nio.ByteBuffer;
/* ------------------------------------------------------------ */
/**
@ -97,6 +98,21 @@ public abstract class Utf8Appendable
throw new RuntimeException(e);
}
}
public void append(ByteBuffer buf)
{
try
{
while (buf.remaining() > 0)
{
appendByte(buf.get());
}
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
public void append(byte[] b, int offset, int length)
{