*
* @throws IOException An underlying IOException occurred
*/
+ @Override
public void realWriteBytes(byte buf[], int off, int cnt)
throws IOException {
conv = AccessController.doPrivileged(
new PrivilegedExceptionAction<C2BConverter>(){
+ @Override
public C2BConverter run() throws IOException{
return new C2BConverter(bb, enc);
}
}
- public int getBytesWritten() {
- if (bytesWritten < Integer.MAX_VALUE) {
- return (int) bytesWritten;
- }
- return -1;
- }
-
- public int getCharsWritten() {
- if (charsWritten < Integer.MAX_VALUE) {
- return (int) charsWritten;
- }
- return -1;
- }
-
- public int getContentWritten() {
- long size = bytesWritten + charsWritten ;
- if (size < Integer.MAX_VALUE) {
- return (int) size;
- }
- return -1;
- }
-
- public long getContentWrittenLong() {
+ public long getContentWritten() {
return bytesWritten + charsWritten;
}
/**
* Return the number of bytes actually written to the output stream.
*/
- public int getContentCount() {
+ public long getContentCount() {
return outputBuffer.getContentWritten();
}
-
- /**
- * Return the number of bytes actually written to the output stream.
- */
- public long getContentCountLong() {
- return outputBuffer.getContentWrittenLong();
- }
/**
* Set the application commit flag.
@Override
public void addElement(StringBuilder buf, Date date, Request request,
Response response, long time) {
- long length = response.getContentCountLong() ;
+ long length = response.getContentCount() ;
if (length <= 0 && conversion) {
buf.append('-');
} else {
// Do nothing on a 1xx, 2xx and 3xx status
// Do nothing if anything has been written already
- if ((statusCode < 400) || (response.getContentCountLong() > 0))
+ if ((statusCode < 400) || (response.getContentCount() > 0))
return;
String message = RequestUtil.filter(response.getMessage());
String user = request.getRemoteUser();
String query=request.getRequestURI();
- long bytes = response.getContentCountLong() ;
+ long bytes = response.getContentCount() ;
if(bytes < 0)
bytes = 0;
int status = response.getStatus();