From 65bc9f7effdb3385a511958f73e08deee98a84c0 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 5 Nov 2002 02:16:46 +0000 Subject: [PATCH] Return number of bytes written when writing a frame. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1893 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/io/FramingOutputStream.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/io/FramingOutputStream.java b/src/java/com/threerings/io/FramingOutputStream.java index f3725ea1c..c8ba72e9d 100644 --- a/src/java/com/threerings/io/FramingOutputStream.java +++ b/src/java/com/threerings/io/FramingOutputStream.java @@ -1,5 +1,5 @@ // -// $Id: FramingOutputStream.java,v 1.1 2002/07/23 05:42:34 mdb Exp $ +// $Id: FramingOutputStream.java,v 1.2 2002/11/05 02:16:46 mdb Exp $ package com.threerings.io; @@ -88,10 +88,12 @@ public class FramingOutputStream extends OutputStream /** * Writes the contents of this framing output stream to the target * output stream, prefixed by an integer with value equal to the - * number of bytes written folling that integer. It then resets the + * number of bytes written following that integer. It then resets the * framing output stream to prepare for another framed message. + * + * @return the total number of bytes written. */ - public void writeFrameAndReset (OutputStream target) + public int writeFrameAndReset (OutputStream target) throws IOException { // prefix the frame with the byte count in network byte order (the @@ -109,6 +111,8 @@ public class FramingOutputStream extends OutputStream // reset our internal buffer reset(); + + return count + 4; } public void reset ()