Remove SkMemoryStream::peek()

I'd like to add a new API to SkStream for peeking - i.e. reading some
bytes without advancing the stream. This will be implemented for the
streams where it makes sense. I think the function should look
something like the following:

size_t peek(void* buffer, size_t bytesToRead) {
     return this->onPeek(buffer, bytesToRead);
}

virtual size_t onPeek(void* buffer, size_t bytesToRead) {
    return 0;   // unimplemented base class.
}

In order to avoid confusion, I'd like to remove SkMemoryStream::peek(),
which is not currently used internally, by Chrome, or by Android as far
as I can tell. There is also another function does the same thing:
getPosition().

BUG=skia:3257

Review URL: https://codereview.chromium.org/1039373002
This commit is contained in:
scroggo 2015-03-27 13:27:51 -07:00 committed by Commit bot
parent 871ad7a13e
commit 5cffba8d8e

View File

@ -315,7 +315,6 @@ public:
void skipToAlign4();
const void* getAtPos();
size_t peek() const { return fOffset; }
size_t read(void* buffer, size_t size) override;
bool isAtEnd() const override;